Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $meta_boxes[] = [
- 'title' => 'Button',
- 'id' => 'btn',
- 'description' => 'Inserts buttons that are either stacked or inline, primary or standard styling.',
- 'type' => 'block',
- 'icon' => 'admin-links',
- 'category' => 'formatting',
- 'keywords' => ['button', 'link', 'action', 'cta'],
- 'render_template' => get_template_directory() . '/blocks/btn.php',
- 'enqueue_style' => $wp_admin_css,
- 'supports' => [
- 'align' => ['wide', 'full'],
- ],
- 'fields' => [
- [
- 'id' => 'btn_group',
- 'type' => 'group',
- 'clone' => true,
- 'add_button' => '+ Add another button',
- 'fields' => [
- [
- 'id' => 'btn_txt',
- 'type' => 'text',
- 'name' => 'Button text'
- ],
- [
- 'id' => 'btn_url',
- 'type' => 'text',
- 'name' => 'Button link'
- ],
- [
- 'id' => 'btn_stacked',
- 'name' => 'Stacked',
- 'type' => 'select',
- 'options' => array(
- '1' => 'Yes',
- '0' => 'No'
- )
- ],
- [
- 'id' => 'btn_style',
- 'name' => 'Style',
- 'type' => 'select',
- 'options' => array(
- 'primary' => 'Primary (pink)',
- 'standard' => 'Standard (blue)'
- )
- ]
- ]
- ]
- ]
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement