Uses
Uses | Description |
---|---|
wp-includes/class-wp-post.php: WP_Post::__isset() | Isset-er. |
wp-includes/class-wp-post.php: WP_Post::__get() | Getter. |
Convert object to array.
(array) Object as array.
File: wp-includes/class-wp-post.php
public function to_array() { $post = get_object_vars( $this ); foreach ( array( 'ancestors', 'page_template', 'post_category', 'tags_input' ) as $key ) { if ( $this->__isset( $key ) ) { $post[ $key ] = $this->__get( $key ); } } return $post; }
Version | Description |
---|---|
3.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_post/to_array