Skip to content

Meta box parameters

solepixel edited this page Apr 6, 2013 · 15 revisions

These are the parameters that can be passed into the $metaboxes array in the main "bmcm_metaboxes" action callback. Most of these parameters are passed directly into the add_meta_box WordPress function.

  • fields (array) (required)
    Array of fields to use in the meta box.
    For a list of supported fields, See: (Supported Field Types)[Getting-Started#built-in-supported-field-types]

  • id (string) (optional)
    ID of your meta box.
    Default: (randomly generated with (uniqid)[http://php.net/manual/en/function.uniqid.php])

  • title (string) (optional)
    Title of your meta box. Appears in the toggle bar and is the main heading for all the fields in the meta box.
    Default: 'Untitled Metabox'

  • post_type (array/string) (optional)
    Post Type or Post Types to display the meta box. Can be 1, passed as a string, or 2 or more passed as an array.
    Default: array('post')

  • context (string) (optional)
    Context of the meta box.
    Default: 'normal'
    See: $context parameter

  • priority (string) (optional)
    Priority of the meta box
    Default: 'high'
    See: $priority parameter

  • tabs (array) (optional)
    List of tabs to render inside the meta box. Each field needs a "tab" parameter that matches the indexes of this array.
    Default: None
    See: Tabs

  • callback (string/array) (optional)
    Function for meta box callback. Rarely will you ever use this, but for advanced users looking for a consistent meta box setup, you can pass a custom callback to build your own meta box contents.
    Default: BM_Custom_Metaboxes::metabox_callback()
    See: [Custom-Callback](Custom Metabox Callback)

  • class (string/array) (optional)
    Gives your meta box a class, for additional customization/styling.
    Default: 'bmcm'

Clone this wiki locally