On this page
WP_Post::__isset( string $key ): bool
Isset-er.
Parameters
$keystring Required-
Property to check if set.
Return
bool
Source
File: wp-includes/class-wp-post.php. View all references
public function __isset( $key ) {
if ( 'ancestors' === $key ) {
return true;
}
if ( 'page_template' === $key ) {
return true;
}
if ( 'post_category' === $key ) {
return true;
}
if ( 'tags_input' === $key ) {
return true;
}
return metadata_exists( 'post', $this->ID, $key );
}
Related
Uses
| Uses | Description |
|---|---|
| metadata_exists() wp-includes/meta.php | Determines if a meta field with the given key exists for the given object ID. |
Used By
| Used By | Description |
|---|---|
| WP_Post::__get() wp-includes/class-wp-post.php | Getter. |
| WP_Post::to_array() wp-includes/class-wp-post.php | Convert object to array. |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_post/__isset