Make WordPress Core

Ticket #43872: 43872.diff

File 43872.diff, 1.5 KB (added by desrosj, 5 years ago)
  • src/wp-includes/class-wp-theme.php

     
    11851185                /**
    11861186                 * Filters list of page templates for a theme.
    11871187                 *
     1188                 * @since 5.0.0
     1189                 *
     1190                 * @param string[]     $post_templates Array of page templates. Keys are filenames,
     1191                 *                                     values are translated names.
     1192                 * @param WP_Theme     $this           The theme object.
     1193                 * @param WP_Post|null $post           The post being edited, provided for context, or null.
     1194                 * @param string       $post_type      Post type to get the templates for.
     1195                 */
     1196                $post_templates = (array) apply_filters( 'theme_templates', $post_templates, $this, $post, $post_type );
     1197
     1198                /**
     1199                 * Filters list of page templates for a theme.
     1200                 *
    11881201                 * The dynamic portion of the hook name, `$post_type`, refers to the post type.
    11891202                 *
    11901203                 * @since 3.9.0
     
    11971210                 * @param WP_Post|null $post           The post being edited, provided for context, or null.
    11981211                 * @param string       $post_type      Post type to get the templates for.
    11991212                 */
    1200                 return (array) apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type );
     1213                $post_templates = (array) apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type );
     1214
     1215                return $post_templates;
    12011216        }
    12021217
    12031218        /**