Skip to content

Options

Noah Mason edited this page Oct 22, 2022 · 6 revisions

WP Backstage can create new custom options, theme, and tools pages with deeply integrated custom fields.

Add

WP_Backstage_Options::add(
    'wp_backstage_options',
    array(
        'type'         => 'settings',
        'title'        => __( 'Test Options', 'wp_backstage_examples' ),
        'menu_title'   => __( 'Test Options', 'wp_backstage_examples' ),
        'description'  => __( 'A test custom options page containing all field types.', 'wp_backstage_examples' ),
        'show_in_rest' => true,
        'sections'     => array(
            array(
                'id'          => 'wp_backstage_options_fields',
                'title'       => __( 'All Fields', 'wp_backstage_examples' ),
                'description' => __( 'These extra meta fields control further options. <a href="#">Example Link</a>', 'wp_backstage_examples' ),
                'fields'      => array(),
            ),
            array(
                'id'          => 'wp_backstage_options_extras',
                'title'       => __( 'Extras', 'wp_backstage_examples' ),
                'description' => __( 'These extra meta fields control further options. <a href="#">Example Link</a>', 'wp_backstage_examples' ),
                'fields' => array(),
            ),
        ),
    )
);
Clone this wiki locally