Skip to content

Instantly share code, notes, and snippets.

@yumyo
Created July 4, 2018 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yumyo/fe3bcae0e3a5131de22b87b7f42a98b3 to your computer and use it in GitHub Desktop.
Save yumyo/fe3bcae0e3a5131de22b87b7f42a98b3 to your computer and use it in GitHub Desktop.
List of WP Objects structure (WP_Post, WP_Post_Type, WP_Term)
WP_Post Object
(
[ID] => 50491
[post_author] => 520
[post_date] => 2016-10-18 19:00:46
[post_date_gmt] => 2016-10-18 18:00:46
[post_content] =>
[post_title] => Home
[post_excerpt] =>
[post_status] => publish
[comment_status] => closed
[ping_status] => closed
[post_password] =>
[post_name] => home
[to_ping] =>
[pinged] =>
[post_modified] => 2018-06-08 09:07:30
[post_modified_gmt] => 2018-06-08 08:07:30
[post_content_filtered] =>
[post_parent] => 0
[guid] => http://xxx.site/?page_id=50491
[menu_order] => 0
[post_type] => page
[post_mime_type] =>
[comment_count] => 0
[filter] => raw
)
WP_Term Object
(
[term_id] => 3
[name] => Business
[slug] => business
[term_group] => 0
[term_taxonomy_id] => 3
[taxonomy] => category
[description] =>
[parent] => 0
[count] => 71
[filter] => raw
[cat_ID] => 3
[category_count] => 71
[category_description] =>
[cat_name] => Business
[category_nicename] => business
[category_parent] => 0
)
WP_Post_Type Object
(
[name] => video
[label] => Videos
[labels] => stdClass Object
(
[name] => Videos
[singular_name] => Video
[add_new] => Add New
[add_new_item] => Add New Video
[edit_item] => Edit Video
[new_item] => New Video
[view_item] => View Video
[view_items] => View Posts
[search_items] => Search Video
[not_found] => Video Not found
[not_found_in_trash] => Video Not found in Trash
[parent_item_colon] =>
[all_items] => All Videos
[archives] => Videos Archive
[attributes] => Post Attributes
[insert_into_item] => Insert into Video
[uploaded_to_this_item] => Uploaded to this Video
[featured_image] => Featured Image
[set_featured_image] => Set featured image
[remove_featured_image] => Remove featured image
[use_featured_image] => Use as featured image
[filter_items_list] => Filter Videos list
[items_list_navigation] => Videos list navigation
[items_list] => Videos list
[menu_name] => Videos
[name_admin_bar] => Videos
[update_item] => Update Video
)
[description] => A post type to manage Videos
[public] => 1
[hierarchical] =>
[exclude_from_search] =>
[publicly_queryable] => 1
[show_ui] => 1
[show_in_menu] => 1
[show_in_nav_menus] => 1
[show_in_admin_bar] => 1
[menu_position] => 28
[menu_icon] => dashicons-video-alt
[capability_type] => page
[map_meta_cap] => 1
[register_meta_box_cb] =>
[taxonomies] => Array
(
[0] => category
[1] => tag
)
[has_archive] => 1
[query_var] => video
[can_export] => 1
[delete_with_user] =>
[_builtin] =>
[_edit_link] => post.php?post=%d
[cap] => stdClass Object
(
[edit_post] => edit_page
[read_post] => read_page
[delete_post] => delete_page
[edit_posts] => edit_pages
[edit_others_posts] => edit_others_pages
[publish_posts] => publish_pages
[read_private_posts] => read_private_pages
[read] => read
[delete_posts] => delete_pages
[delete_private_posts] => delete_private_pages
[delete_published_posts] => delete_published_pages
[delete_others_posts] => delete_others_pages
[edit_private_posts] => edit_private_pages
[edit_published_posts] => edit_published_pages
[create_posts] => edit_pages
)
[rewrite] => Array
(
[slug] => video
[with_front] => 1
[pages] => 1
[feeds] => 1
[ep_mask] => 1
)
[show_in_rest] =>
[rest_base] =>
[rest_controller_class] =>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment