mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@39236 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1038,7 +1038,7 @@ final class WP_Theme implements ArrayAccess {
|
||||
}
|
||||
|
||||
foreach ( $types as $type ) {
|
||||
$type = trim( $type );
|
||||
$type = sanitize_key( $type );
|
||||
if ( ! isset( $post_templates[ $type ] ) ) {
|
||||
$post_templates[ $type ] = array();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user