Android & Wordpress Help center

WordPress: Add meta box in edit post screen.


The add_meta_box() function was introduced in Version 2.5. It allows plugin developers to add sections to the Write Post, Write Page, and Write Link editing pages.


add_meta_box( $id, $title, $callback, $post_type,

 $context, $priority, $callback_args );


(string) (required) HTML ‘id’ attribute of the edit screen section

Default: None
(string) (required) Title of the edit screen section, visible to user

Default: None
(callback) (required) Function that prints out the HTML for the edit screen section. Pass function name as a string. Within a class, you can instead pass an array to call one of the class’s methods. See the second example under Examplebelow.

Default: None
(string) (required) The type of Write screen on which to show the edit screen section ('post', 'page', 'link', or 'custom_post_type'where custom_post_type is the custom post type slug)

Default: None
(string) (optional) The part of the page where the edit screen section should be shown ('normal', 'advanced', or 'side'). (Note that ‘side’ doesn’t exist before 2.7)

Default: ‘advanced’
(string) (optional) The priority within the context where the boxes should show ('high', 'core', 'default' or 'low')

Default: ‘default’
(array) (optional) Arguments to pass into your callback function. The callback will receive the $post object and whatever parameters are passed through this variable.

Default: null



Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: