Advertisement
mv_arteric

MB Block Definition

Dec 3rd, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | None | 0 0
  1. <?php
  2.  
  3. add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
  4.     $meta_boxes[] = [
  5.         'title'           => 'Circle Image and Text',
  6.         'id'              => 'circle-image-text',
  7.         'description'     => 'Two column circle gradient and text with button',
  8.         'type'            => 'block',
  9.         'icon'            => 'awards',
  10.         'category'        => 'layout',
  11.         'context'         => 'side',
  12.         'render_template' => get_template_directory() . '/blocks/templates/circle-image-text.php',
  13.         'supports' => [
  14.             'align' => true,
  15.         ],
  16.  
  17.         'fields' => [
  18.             [  
  19.                 'id'    =>  'left-image',
  20.                 'name'  =>  'Left Column Image',
  21.                 'type'  =>  'single_image'
  22.             ],
  23.             [
  24.                 'type'  => 'textarea',
  25.                 'name'  => 'right-text',
  26.                 'name'  => 'Right Column text'
  27.             ],
  28.             [
  29.                 'type'  => 'textarea',
  30.                 'name'  => 'right-text',
  31.                 'name'  => 'Right Column text'
  32.             ],
  33.             [
  34.                 'type'  => 'text',
  35.                 'name'  => 'button-text',
  36.                 'name'  => 'Button Text'
  37.             ],
  38.             [
  39.                 'type'  => 'textarea',
  40.                 'name'  => 'button-link',
  41.                 'name'  => 'Button Link'
  42.             ]
  43.  
  44.         ],
  45.     ];
  46.         return $meta_boxes;
  47. });`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement