WordPress.org

Make WordPress Core

Ticket #18750: 18750.2.diff

File 18750.2.diff, 881 bytes (added by billerickson, 7 years ago)
  • wp-includes/post-template.php

     
    12601260}
    12611261
    12621262/**
     1263 * Get the specific template name for a page.
     1264 *
     1265 * @param string $id The page ID to check. If not provided, will use current page
     1266 * @return string The specific template name if success, bool False on failure
     1267 */
     1268function get_the_page_template( $id = '' ) {
     1269        if( !is_page() )
     1270                return false;
     1271               
     1272        if( empty( $id ) )
     1273                $id = get_queried_object_id();
     1274               
     1275        $page_template = get_post_meta( $id, '_wp_page_template', true );
     1276        if( !empty( $page_template ) )
     1277                return $page_template;
     1278        else
     1279                return false;
     1280}
     1281 
     1282
     1283/**
    12631284 * Retrieve formatted date timestamp of a revision (linked to that revisions's page).
    12641285 *
    12651286 * @package WordPress