inc/metabox-api.php

largo_add_meta_box()

Call this function to define a metabox container

Since:

0.2

Parameters:
  • $id (string) – Required. HTML ‘id’ attribute of edit screen section. Corresponds to first argument of add_meta_box()
  • $title (string) – Required. Title of the metabox, visible to user
  • $screens (array|string) – Optional. Name of post type(s) this box should appear on. Values correspond to $post_type argument of add_meta_box(). Defaults to ‘post’
  • $context (string) – Optional. The context within the page where the boxes should show (‘normal’, ‘advanced’, ‘side’). Defaults to ‘advanced’
  • $priority (string) – Optional. The priority within the context where the boxes should show (‘high’, ‘low’, ‘core’, ‘default’). Defaults to ‘default’
largo_add_meta_content()

Call this function to add a field to an (existing) metabox container

TODO: Implement some sort of weighting protocol to control ordering of fields within a metabox (right now it’s just FIFO)

Since:

0.2

Parameters:
  • $callback (string) – Required. Function that outputs the markup for this field
  • $box_id (string) – Required. HTML ‘id’ attribute of the box this field goes into
largo_register_meta_input()

Call this function from within a largo_add_meta_box callback to register an input as a post meta field

TODO: Include a validation parameter so meta fields can be validated easily.

Since:

0.2

Parameters:
  • $input_names (string|array) – Name of a single input or array of input names to add as meta fields
_largo_metaboxes_generate()

Private function to actually generate the metaboxes

_largo_metaboxes_content()

Private function to generate fields/markup within largo metaboxes