Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Widget Name: IMM : Box Carousel
- Description: IMM - Box Carousel
- Author: IMM
- Author URI: -
- */
- class IMMBoxCarousel extends SiteOrigin_Widget {
- function __construct() {
- parent::__construct(
- 'imm-box-carousel',
- __( 'IMM : Box Carousel', 'imm' ),
- array(
- 'description' => __( 'IMM - Box Carousel', 'imm' ),
- 'panels_groups' => array('imm')
- ),
- array(),
- false,
- plugin_dir_path( __FILE__ )
- );
- }
- function get_widget_form() {
- return array(
- 'title' => array(
- 'type' => 'text',
- 'label' => __( 'Title', 'imm' ),
- 'default' => ''
- ),
- 'description' => array(
- 'type' => 'textarea',
- 'label' => __( 'Description', 'imm' ),
- 'default' => ''
- ),
- 'box_repeater' => array(
- 'type' => 'repeater',
- 'label' => __( 'Boxes' , 'imm' ),
- 'item_name' => __( 'Box', 'imm' ),
- 'item_label' => array(
- 'selector' => "[id*='box_title']",
- 'update_event' => 'change',
- 'value_method' => 'val'
- ),
- 'fields' => array(
- 'box_title' => array(
- 'type' => 'text',
- 'label' => __( 'Box Title', 'imm' ),
- 'default' => ''
- ),
- 'box_desc' => array(
- 'type' => 'textarea',
- 'label' => __( 'Box Description', 'imm' ),
- 'default' => ''
- ),
- 'box_image' => array(
- 'type' => 'media',
- 'label' => __( 'Choose an image', 'imm' ),
- 'choose' => __( 'Choose image', 'imm' ),
- 'update' => __( 'Set image', 'imm' ),
- 'library' => 'image',
- 'fallback' => true
- ),
- 'box_url' => array(
- 'type' => 'link',
- 'label' => __('Box Link', 'imm'),
- 'default' => '#'
- ),
- )
- )
- );
- }
- }
- siteorigin_widget_register( 'imm-box-carousel', __FILE__, 'IMMBoxCarousel' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement