Skip to content

Commit

Permalink
Add sanitize post type in case users use CamelCase in post type name. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Anh committed May 4, 2017
1 parent e4b1653 commit 51dddec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/meta-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ public static function normalize( $meta_box ) {
$meta_box['post_types'] = $meta_box['pages'];
}

// Make sure the post type is an array.
$meta_box['post_types'] = (array) $meta_box['post_types'];
// Make sure the post type is an array and is sanitized.
$meta_box['post_types'] = array_map( 'sanitize_key', (array) $meta_box['post_types'] );

return $meta_box;
}
Expand Down

0 comments on commit 51dddec

Please sign in to comment.