WP_Post_Type::register_meta_boxes() WordPress Method

The WP_Post_Type::register_meta_boxes() method allows you to add meta boxes to a custom post type. This is useful for adding custom fields to a post type. The first parameter is an array of meta box options. The second parameter is the post type name. The third parameter is the post type object.

WP_Post_Type::register_meta_boxes() #

Registers the post type meta box if a custom callback was specified.


Source

File: wp-includes/class-wp-post-type.php

	public function register_meta_boxes() {
		if ( $this->register_meta_box_cb ) {
			add_action( 'add_meta_boxes_' . $this->name, $this->register_meta_box_cb, 10, 1 );
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.