WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/15/2016 03:36:13 AM (3 years ago)
Author:
peterwilsoncc
Message:

Posts, Post Types: Improve sanitisation of templates' post types.

Prevents post type templates ignoring post types due to invalid characters. Each entry in the Template Post Type comment is run through sanitize_key() to match the sanitisation used by register_post_type().

Fixes #38766.

File:
1 edited

Legend:

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

    r39168 r39236  
    10391039
    10401040                foreach ( $types as $type ) {
    1041                     $type = trim( $type );
     1041                    $type = sanitize_key( $type );
    10421042                    if ( ! isset( $post_templates[ $type ] ) ) {
    10431043                        $post_templates[ $type ] = array();
Note: See TracChangeset for help on using the changeset viewer.