* @copyright Copyright (c) 2017, Themeisle * @link http://themeisle.com/ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html */ if ( ! class_exists( 'WP_Customize_Control' ) ) { return; } /** * Radio image customize control. * * @since 1.0 * @access public */ class Allo_Customize_Control_Tabs extends WP_Customize_Control { /** * Allo_Customize_Control_Tabs constructor. * * @param WP_Customize_Manager $manager wp_customize manager. * @param string $id control id. * @param array $args public parameters for control. */ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) { parent::__construct( $manager, $id, $args ); add_action( 'customize_preview_init', array( $this, 'partials_helper_script_enqueue' ) ); if ( ! empty( $this->tabs ) ) { foreach ( $this->tabs as $value => $args ) { $this->controls[ $value ] = $args['controls']; } } } /** * Controls array from tabs. * * @var array */ public $controls = array(); /** * The type of customize control being rendered. * * @since 1.0 * @var string */ public $type = 'interface-tabs'; /** * The type refresh being used. * * @since 1.0 * @var string */ public $transport = 'postMessage'; /** * The priority of the control. * * @since 1.0 * @var string */ public $priority = -10; /** * The tabs with keys of the controls that are under each tab. * * @since 1.0 * @var array */ public $tabs; /** * Displays the control content. * * @since 1.0 * @access public * @return void */ public function render_content() { /* If no tabs are provided, bail. */ if ( empty( $this->tabs ) || ! $this->more_than_one_valid_tab() ) { return; } $output = ''; $i = 0; $output .= '