Changeset 3336797
- Timestamp:
- 07/30/2025 06:06:14 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
simple-page-folder-organizer/trunk/simple-page-folder-organizer.php
r3286913 r3336797 20 20 add_action( 'restrict_manage_posts', [$this, 'c2tw_add_folder_filter_dropdown'] ); 21 21 add_filter( 'parse_query', [$this, 'c2tw_filter_pages_by_folder'] ); 22 add_filter( 'body_class', [$this, 'c2tw_add_folder_class_to_body'] ); 22 23 } 23 24 25 /* === Add Body Class === */ 26 public function c2tw_add_folder_class_to_body( $classes ) { 27 if ( is_page() ) { 28 $terms = get_the_terms( get_the_ID(), 'c2tw_page_folder' ); 29 if ( $terms && ! is_wp_error( $terms ) ) { 30 foreach ( $terms as $term ) { 31 $classes[] = 'c2twfolder-' . sanitize_html_class( $term->slug ); 32 } 33 } 34 } 35 return $classes; 36 } 37 24 38 public function c2tw_register_page_folder_taxonomy() { 25 39 $labels = [
Note: See TracChangeset
for help on using the changeset viewer.