Opened 9 years ago
Closed 9 years ago
#37369 closed defect (bug) (invalid)
registered_meta_key_exists() must return only Boolean, not WP_error as it is used by unregister_meta_key() and get_registered_metadata() which alredy return WP_error
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.6 |
Component: | Options, Meta APIs | Keywords: | has-patch |
Focuses: | Cc: |
Description
registered_meta_key_exists()
must return only Boolean, not WP_error as it is used by unregister_meta_key()
and get_registered_metadata()
which has<br />
<?php if ( ! registered_meta_key_exists( $object_type, $object_subtype, $meta_key ) ) { return new WP_Error( 'invalid_meta_key', __( 'Invalid meta key. Not registered.' ) ); }
this type of condition and if the WP_error is return then it will not throw error, but it goes further.
Attachments (2)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Refresh this patch added comment and removed if conditions from unregister_meta_key() as it is already checked in registered_meta_key_exists()