Changeset 12263 for sites/trunk/wp-themes.com/public_html/wp-content/mu-plugins/pub/starter-content.php
- Timestamp:
- 11/22/2022 03:39:56 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wp-themes.com/public_html/wp-content/mu-plugins/pub/starter-content.php
r10870 r12263 125 125 $this->filter_nav_menus(); 126 126 $this->filter_post_thumbnails(); 127 $this->filter_page_template(); 127 128 $this->filter_sidebars(); 128 129 $this->filter_theme_mods(); … … 174 175 public function filter_posts() { 175 176 add_filter( 'posts_pre_query', array( $this, 'filter_page_query' ), 10, 2 ); 177 } 178 179 public function filter_page_template() { 180 181 add_filter( 182 'get_post_metadata', 183 function( $value, $post_id, $meta_key ) { 184 if ( '_wp_page_template' !== $meta_key ) { 185 return $value; 186 } 187 188 $post_data = $this->find_data_by_id( $post_id ); 189 190 return $post_data['template'] ?? $value; 191 }, 192 10, 193 3 194 ); 176 195 } 177 196
Note: See TracChangeset
for help on using the changeset viewer.