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
1094            * @since 4.4.0 Converted to allow complete control over the `$page_templates` array.
1095            * @since 4.7.0 Added the `$post_type` parameter.
1096            *
1097            * @param array        $post_templates Array of page templates. Keys are filenames,
1098            *                                     values are translated names.
1099            * @param WP_Theme     $this           The theme object.
1100            * @param WP_Post|null $post           The post being edited, provided for context, or null.
1101            * @param string       $post_type      Post type to get the templates for.
1102            */
1103           return (array) apply_filters( "theme_{$post_type}_templates", $post_templates, $this, $post, $post_type );
1104      }
1105
1106      /**
1107       * Scans a directory for files of a certain extension.
1108       *
1109       * @since 3.4.0
1110       *
1111       * @static
1112       * @access private