mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 07:07:04 +00:00
Taxonomy: Prevent non string taxonomy names generating warnings or errors.
This changeset adds an `is_string( $taxonomy )` check to the condition in `taxonomy_exists()`, to ensure `false` is returned when the `$taxonomy` is not a string. Follow-up to [35718]. Props costdev, peterwilsoncc, mukesh27. Fixes #56338. See #56336. git-svn-id: https://develop.svn.wordpress.org/trunk@53869 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -337,7 +337,7 @@ function get_taxonomy( $taxonomy ) {
|
||||
function taxonomy_exists( $taxonomy ) {
|
||||
global $wp_taxonomies;
|
||||
|
||||
return isset( $wp_taxonomies[ $taxonomy ] );
|
||||
return is_string( $taxonomy ) && isset( $wp_taxonomies[ $taxonomy ] );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user