Changeset 27470 for trunk/src/wp-includes/class-wp-theme.php
- Timestamp:
- 03/08/2014 04:18:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r27297 r27470 932 932 * @access public 933 933 * 934 * @param WP_Post|null $post Optional. The post being edited, provided for context. 934 935 * @return array Array of page templates, keyed by filename, with the value of the translated header name. 935 936 */ 936 public function get_page_templates( ) {937 public function get_page_templates( $post = null ) { 937 938 // If you screw up your current theme and we invalidate your parent, most things still work. Let it slide. 938 939 if ( $this->errors() && $this->errors()->get_error_codes() !== array( 'theme_parent_invalid' ) ) … … 962 963 963 964 if ( $this->parent() ) 964 $page_templates += $this->parent()->get_page_templates( );965 $page_templates += $this->parent()->get_page_templates( $post ); 965 966 966 967 /** … … 971 972 * @since 3.9.0 972 973 * 973 * @param array $page_templates Array of page templates. Keys are filenames, 974 * values are translated names. 975 * @param WP_Theme $this The theme object. 974 * @param array $page_templates Array of page templates. Keys are filenames, 975 * values are translated names. 976 * @param WP_Theme $this The theme object. 977 * @param WP_Post|null $post The post being edited, provided for context, or null. 976 978 */ 977 $return = apply_filters( 'page_templates', $page_templates, $this ); 979 error_log( serialize( $this ) ); 980 $return = apply_filters( 'theme_page_templates', $page_templates, $this, $post ); 978 981 return array_intersect_assoc( $return, $page_templates ); 979 982 }
Note: See TracChangeset
for help on using the changeset viewer.