Advertisement
Guest User

imm-box-carousel.php

a guest
Aug 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.01 KB | None | 0 0
  1. <?php
  2. /*
  3. Widget Name: IMM : Box Carousel
  4. Description: IMM - Box Carousel
  5. Author: IMM
  6. Author URI: -
  7. */
  8.  
  9. class IMMBoxCarousel extends SiteOrigin_Widget {
  10.     function __construct() {
  11.         parent::__construct(
  12.             'imm-box-carousel',
  13.             __( 'IMM : Box Carousel', 'imm' ),
  14.             array(
  15.                 'description' => __( 'IMM - Box Carousel', 'imm' ),
  16.                 'panels_groups' => array('imm')
  17.             ),
  18.             array(),
  19.             false,
  20.             plugin_dir_path( __FILE__ )
  21.         );
  22.     }
  23.     function get_widget_form() {
  24.         return array(
  25.       'title' => array(
  26.           'type' => 'text',
  27.           'label' => __( 'Title', 'imm' ),
  28.           'default' => ''
  29.       ),
  30.       'description' => array(
  31.           'type' => 'textarea',
  32.           'label' => __( 'Description', 'imm' ),
  33.           'default' => ''
  34.       ),
  35.       'box_repeater' => array(
  36.         'type' => 'repeater',
  37.         'label' => __( 'Boxes' , 'imm' ),
  38.         'item_name'  => __( 'Box', 'imm' ),
  39.         'item_label' => array(
  40.             'selector'     => "[id*='box_title']",
  41.             'update_event' => 'change',
  42.             'value_method' => 'val'
  43.         ),
  44.         'fields' => array(
  45.           'box_title' => array(
  46.               'type' => 'text',
  47.               'label' => __( 'Box Title', 'imm' ),
  48.               'default' => ''
  49.           ),
  50.           'box_desc' => array(
  51.               'type' => 'textarea',
  52.               'label' => __( 'Box Description', 'imm' ),
  53.               'default' => ''
  54.           ),
  55.           'box_image' => array(
  56.             'type' => 'media',
  57.             'label' => __( 'Choose an image', 'imm' ),
  58.             'choose' => __( 'Choose image', 'imm' ),
  59.             'update' => __( 'Set image', 'imm' ),
  60.             'library' => 'image',
  61.             'fallback' => true
  62.           ),
  63.           'box_url' => array(
  64.               'type' => 'link',
  65.               'label' => __('Box Link', 'imm'),
  66.               'default' => '#'
  67.           ),
  68.         )
  69.       )
  70.         );
  71.     }
  72. }
  73.  
  74. siteorigin_widget_register( 'imm-box-carousel', __FILE__, 'IMMBoxCarousel' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement