Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Widget Name: FAQ Content
- Description: FAQ Content
- Author: IMM
- Author URI: https://islandmediamanagement.com
- */
- class Faq_Content extends SiteOrigin_Widget {
- function __construct() {
- parent::__construct(
- 'faq-content',
- __( 'FAQ Content', 'imm-widget' ),
- array(
- 'description' => __( 'FAQ Content', 'imm-widget' ),
- 'panels_groups' => array('imm')
- ),
- array(),
- false,
- plugin_dir_path( __FILE__ )
- );
- }
- function initialize() {
- $this->register_frontend_styles(
- array(
- array( 'faq-content', THEME_MODULES_URI . '/so-widgets/faq-content/assets/faq-content.css' )
- )
- );
- $this->register_frontend_scripts(
- array(
- array( 'faq-content', THEME_MODULES_URI . '/so-widgets/faq-content/assets/faq-content.js' )
- )
- );
- }
- function enqueue_frontend_scripts( $instance ) {
- // wp_enqueue_style('slick');
- // wp_enqueue_script('slick');
- $this->enqueue_registered_scripts( $instance );
- $this->enqueue_registered_styles( $instance );
- }
- function get_widget_form() {
- return array(
- 'beginning_content' => array(
- 'type' => 'tinymce',
- 'label' => __( 'beginning Content', 'imm-widget' ),
- ),
- 'itinerary_repeater' => array(
- 'type' => 'repeater',
- 'label' => __( 'Testimonial repeater' , 'imm-widget' ),
- 'item_name' => __( 'Testimonial item', 'imm-widget' ),
- 'item_label' => array(
- 'selector' => "[id*='title_content']",
- 'update_event' => 'change',
- 'value_method' => 'val'
- ),
- 'fields' => array(
- 'title_content' => array(
- 'type' => 'text',
- 'label' => __( 'Title Menu', 'imm-widget' ),
- 'state_emitter' => array(
- 'callback' => 'select',
- 'args' => array( 'field_type_{$repeater}' ),
- )
- ),
- 'content_text' => array(
- 'type' => 'tinymce',
- 'label' => __( 'Content Menu', 'imm-widget' ),
- 'state_handler' => array(
- 'map_type[interactive]' => array('hide'),
- 'map_type[static]' => array('show'),
- ),
- ),
- 'map_type' => array(
- 'type' => 'radio',
- 'default' => 'static',
- 'label' => __( 'Add Sub Item?', 'siteorigin-widgets' ),
- 'state_emitter' => array(
- 'callback' => 'select',
- 'args' => array( 'map_type' )
- ),
- 'options' => array(
- 'interactive' => __( 'Yes', 'siteorigin-widgets' ),
- 'static' => __( 'No', 'siteorigin-widgets' ),
- )
- ),
- 'sub_items' => array(
- 'type' => 'repeater',
- 'label' => __( 'Sub item', 'imm-widget' ),
- 'item_name' => __( 'Item Name', 'imm-widget' ),
- 'item_label' => array(
- 'selector' => "[id*='title_item']",
- 'update_event' => 'change',
- 'value_method' => 'val'
- ),
- 'fields' => array(
- 'title_item' => array(
- 'type' => 'text',
- 'label' => __( 'Title Item', 'imm-widget' ),
- ),
- 'content_item' => array(
- 'type' => 'tinymce',
- 'label' => __( 'Content Menu', 'imm-widget' ),
- ),
- ),
- 'state_handler' => array(
- 'map_type[interactive]' => array('show'),
- 'map_type[static]' => array('hide'),
- ),
- 'label' => __( 'Sub Item', 'siteorigin-widgets' )
- ),
- )
- )
- );
- }
- }
- siteorigin_widget_register( 'faq-content', __FILE__, 'Faq_Content' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement