Constructor.
Parameters
$postWP_Post|objectrequired- Post object.
Source
public function __construct( $post ) {
foreach ( get_object_vars( $post ) as $key => $value ) {
$this->$key = $value;
}
}
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
| CARVIEW |
Constructor.
$postWP_Post|objectrequiredpublic function __construct( $post ) {
foreach ( get_object_vars( $post ) as $key => $value ) {
$this->$key = $value;
}
}
| Used by | Description |
|---|---|
update_ignored_hooked_blocks_postmeta()wp-includes/blocks.php | Updates the wp_postmeta with the list of ignored hooked blocks where the inner blocks are stored as post content. |
inject_ignored_hooked_blocks_metadata_attributes()wp-includes/block-template-utils.php | Inject ignoredHookedBlocks metadata attributes into a template or template part. |
WP_Customize_Nav_Menu_Item_Setting::value_as_wp_post_nav_menu_item()wp-includes/customize/class-wp-customize-nav-menu-item-setting.php | Get the value emulated into a WP_Post and set up as a nav_menu_item. |
get_attachment_fields_to_edit()wp-admin/includes/media.php | Retrieves the attachment fields to edit form fields. |
get_default_post_to_edit()wp-admin/includes/post.php | Returns default post information to use when populating the “Write Post” form. |
WP_Post::get_instance()wp-includes/class-wp-post.php | Retrieve WP_Post instance. |
get_post()wp-includes/post.php | Retrieves post data given a post ID or post object. |
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.