Make WordPress Core

Changeset 27297


Ignore:
Timestamp:
02/26/2014 08:31:00 PM (11 years ago)
Author:
nacin
Message:

Add a filter to remove or rename page templates for a theme. This does not yet handle adding page templates. see #13265.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme.php

    r26891 r27297  
    964964            $page_templates += $this->parent()->get_page_templates();
    965965
    966         return $page_templates;
     966        /**
     967         * Remove or rename page templates for a theme.
     968         *
     969         * This filter does not currently allow for page templates to be added.
     970         *
     971         * @since 3.9.0
     972         *
     973         * @param array    $page_templates Array of page templates. Keys are filenames,
     974         *                                 values are translated names.
     975         * @param WP_Theme $this           The theme object.
     976         */
     977        $return = apply_filters( 'page_templates', $page_templates, $this );
     978        return array_intersect_assoc( $return, $page_templates );
    967979    }
    968980
Note: See TracChangeset for help on using the changeset viewer.