Docs: Docs on docs. Further improve documentation of known return types, plus other docs fixes.

See #48303


git-svn-id: https://develop.svn.wordpress.org/trunk@46662 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2019-11-05 21:28:51 +00:00
parent 3cdee7a705
commit 46581088d5
15 changed files with 49 additions and 43 deletions

View File

@@ -112,14 +112,14 @@ function delete_theme( $stylesheet, $redirect = '' ) {
}
/**
* Get the Page Templates available in this theme
* Gets the page templates available in this theme.
*
* @since 1.5.0
* @since 4.7.0 Added the `$post_type` parameter.
*
* @param WP_Post|null $post Optional. The post being edited, provided for context.
* @param string $post_type Optional. Post type to get the templates for. Default 'page'.
* @return array Key is the template name, value is the filename of the template
* @return string[] Array of template file names keyed by the template header name.
*/
function get_page_templates( $post = null, $post_type = 'page' ) {
return array_flip( wp_get_theme()->get_page_templates( $post, $post_type ) );