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. Built from https://develop.svn.wordpress.org/trunk@39236 git-svn-id: http://core.svn.wordpress.org/trunk@39176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fc1255a2c7
commit
21248ce3ab
|
@ -1038,7 +1038,7 @@ final class WP_Theme implements ArrayAccess {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ( $types as $type ) {
|
foreach ( $types as $type ) {
|
||||||
$type = trim( $type );
|
$type = sanitize_key( $type );
|
||||||
if ( ! isset( $post_templates[ $type ] ) ) {
|
if ( ! isset( $post_templates[ $type ] ) ) {
|
||||||
$post_templates[ $type ] = array();
|
$post_templates[ $type ] = array();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-beta3-39235';
|
$wp_version = '4.7-beta3-39236';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue