Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: theme_{$post_type}_templates

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1288            * @since 3.9.0
1289            * @since 4.4.0 Converted to allow complete control over the `$page_templates` array.
1290            * @since 4.7.0 Added the `$post_type` parameter.
1291            *
1292            * @param string[]     $post_templates Array of template header names keyed by the template file name.
1293            * @param WP_Theme     $theme          The theme object.
1294            * @param WP_Post|null $post           The post being edited, provided for context, or null.
1295            * @param string       $post_type      Post type to get the templates for.
1296            */
1297           $post_templates = (array) apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type );
1298
1299           return $post_templates;
1300      }
1301
1302      /**
1303       * Scans a directory for files of a certain extension.
1304       *
1305       * @since 3.4.0
1306       *