Property | Type | Description | |
---|---|---|---|
$fields | Fields information | ||
$meta_box | Meta box information | ||
$saved | Used to prevent duplicated calls like revisions, manual hook to wp_insert_post, etc. |
Method | Description | |
---|---|---|
__construct ( array $meta_box ) | Create meta box based on given data | |
add_meta_boxes ( ) | Add meta box for multiple post types | |
enqueue ( ) | Enqueue common scripts and styles. | |
hide ( array $hidden, object $screen ) : array | Hide meta box if it's set 'default_hidden' | |
is_edit_screen ( WP_Screen $screen = null ) : boolean | Check if we're on the right edit screen. | |
is_saved ( ) : boolean | Check if meta box is saved before. | |
normalize ( array $meta_box ) : array | Normalize parameters for meta box | |
normalize_fields ( array $fields ) : array | Normalize an array of fields | |
save_post ( integer $post_id ) | Save data from meta box | |
show ( ) | Callback function to show fields in meta box |
Method | Description | |
---|---|---|
global_hooks ( ) | Add global hooks. | |
is_shown ( ) : boolean | Conditional check for whether initializing meta box. | |
object_hooks ( ) | Specific hooks for meta box object. Default is 'post'. | |
validate ( ) : boolean | Validate form when submit. Check: - If this function is called to prevent duplicated calls like revisions, manual hook to wp_insert_post, etc. |
public __construct ( array $meta_box ) | ||
$meta_box | array | Meta box definition |
public is_edit_screen ( WP_Screen $screen = null ) : boolean | ||
$screen | WP_Screen | Screen object. Optional. Use current screen object by default. |
return | boolean |
public static normalize_fields ( array $fields ) : array | ||
$fields | array | Array of fields |
return | array | $fields Normalized fields |
protected object_hooks ( ) |