Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'rwmb_meta_boxes' , function ($meta_boxes ) {
- $myblock = [
- 'title' => 'Hero Content',
- 'id' => 'hero-content',
- 'description' => 'A custom hero content block',
- 'type' => 'block',
- 'icon' => 'awards',
- 'category' => 'layout',
- 'context' => 'side',
- 'render_template' => get_template_directory() . '/dummy.php',
- //'enqueue_style' => get_template_directory_uri() . '/blocks/hero/style.css',
- 'supports' => [
- 'align' => ['wide', 'full'],
- ],
- // Block fields.
- 'fields' => [
- [
- 'type' => 'single_image',
- 'id' => 'image',
- 'name' => 'Image',
- ],
- [
- 'type' => 'text',
- 'id' => 'title',
- 'name' => 'Title',
- ],
- [
- 'type' => 'text',
- 'id' => 'subtitle',
- 'name' => 'Subtitle',
- ],
- [
- 'type' => 'textarea',
- 'id' => 'content',
- 'name' => 'Content',
- ],
- [
- 'type' => 'single_image',
- 'id' => 'signature',
- 'name' => 'Signature',
- ],
- [
- 'type' => 'text',
- 'id' => 'button_text',
- 'name' => 'Button Text',
- ],
- [
- 'type' => 'text',
- 'id' => 'button_url',
- 'name' => 'Button URL',
- ],
- [
- 'type' => 'color',
- 'id' => 'background_color',
- 'name' => 'Background Color',
- ],
- ],
- ];
- $meta_boxes[] = $myblock;
- return $meta_boxes;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement