Alchemy Options Docs
v0.9
v0.9
  • Read Me
  • Installation
  • Configuration
  • Meta Boxes
  • Theme mode
  • Samples
  • Field types
    • Text
    • Password
    • URL
    • Email
    • Tel
    • Textarea
    • Editor (WYSIWYG)
    • Datepicker
    • Image upload
    • Radio buttons
    • Select
    • Checkbox
    • Colorpicker
    • Image radio
    • Post type select
    • Datalist
    • Sections
    • Repeater
    • Button group
    • Slider
    • Taxonomy select
    • Field group
  • Functions
    • alch_options_id
    • alch_network_options_id
    • alch_get_option
    • alch_get_network_option
    • alch_delete_value
    • alch_get_post_meta
  • Javascript
    • getOption
    • getNetworkOption
    • getPostMeta
  • Filters
    • alch_options_id
    • alch_network_options_id
    • alch_options_id() . '_args'
    • alch_network_options_id() . '_args'
    • alch_allowed_editor_html_tags
    • alch_allowed_editor_protocols
    • alch_value_{ $optionID }
    • alch_network_value_{ $optionID }
Powered by GitBook
On this page

Meta Boxes

PreviousConfigurationNextTheme mode

Last updated 4 years ago

Alchemy Options fields can be used in . Please take a look at the following configuration example.

function add_custom_meta_boxes() {
    if( ! class_exists( 'Alchemy_Options\Includes\Meta_Boxes' ) || wp_doing_ajax() ) {
        return;
    }

    $meta_boxes = array(
        array(
            'id' => 'meta_box',
            'title' => 'Meta box title',
            'post-types' => array( 'page' ),
            'meta' => array(
                'options' => array(),
            ),
        ),
    );

    new Alchemy_Options\Includes\Meta_Boxes( $meta_boxes );
}

add_action( 'init', 'add_custom_meta_boxes' );

Params

Name

Type

Description

id

string

Unique ID (required)

title

string

Shows a heading on the meta box (required)

post-types

array

A list of post types where this meta box should appear (required)

meta

array

A list of meta options. Should have the options array containing regular options signatures (required)

Meta Boxes