'_customize-dropdown-categories-' . $this->id, 'echo' => 0, 'show_option_none' => __( '— Select Category —', 'news-portal' ), 'option_none_value' => '0', 'selected' => $this->value(), ) ); // Hackily add in the data link parameter. $dropdown = str_replace( 'get_link(), $dropdown ); printf( '', $this->label, $this->description, $dropdown ); } } // end News_Portal_Customize_Category_Control /*-----------------------------------------------------------------------------------------------------------------------*/ /** * Switch button customize control. * * @since 1.0.3 * @access public */ class News_Portal_Customize_Switch_Control extends WP_Customize_Control { /** * The type of customize control being rendered. * * @since 1.0.0 * @access public * @var string */ public $type = 'switch'; /** * Displays the control content. * * @since 1.0.0 * @access public * @return void */ public function render_content() { ?> choices as $value => $args ) $this->choices[ $value ]['url'] = esc_url( sprintf( $args['url'], get_template_directory_uri(), get_stylesheet_directory_uri() ) ); $this->json['choices'] = $this->choices; $this->json['link'] = $this->get_link(); $this->json['value'] = $this->value(); $this->json['id'] = $this->id; } /** * Underscore JS template to handle the control's output. * * @since 1.0.0 * @access public * @return void */ public function content_template() { ?> <# if ( data.label ) { #> {{ data.label }} <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>
<# for ( key in data.choices ) { #> checked="checked" <# } #> /> <# } #>
fields = $fields; $this->news_portal_box_label = $args['news_portal_box_label'] ; $this->news_portal_box_add_control = $args['news_portal_box_add_control']; parent::__construct( $manager, $id, $args ); } public function render_content() { $values = json_decode( $this->value() ); $repeater_id = $this->id; $field_count = count( $values ); ?> label ); ?> description ){ ?> description ); ?> link() ); ?> class="np-repeater-collector" value="value() ); ?>" /> fields; $values = json_decode( $this->value() ); if ( is_array( $values ) ){ foreach( $values as $value ){ ?>
  • news_portal_box_label ); ?>

    $field ) { $class = isset( $field['class'] ) ? $field['class'] : ''; ?>
    $key ) ? $value->$key : ''; $default = isset( $field['default'] ) ? $field['default'] : ''; switch ( $field['type'] ) { case 'text': echo ''; break; case 'url': echo ''; break; case 'social_icon': echo '
    '; echo ''; echo ''; echo '
    '; echo '
      '; $news_portal_font_awesome_social_icon_array = news_portal_font_awesome_social_icon_array(); foreach ( $news_portal_font_awesome_social_icon_array as $news_portal_font_awesome_icon ) { $icon_class = $new_value == $news_portal_font_awesome_icon ? 'icon-active' : ''; echo '
    • '; } echo '
    '; echo ''; break; default: break; } ?>
  • label ); ?>
    description); ?>
    pro_text; $json['pro_url'] = esc_url( $this->pro_url ); return $json; } /** * Outputs the Underscore.js template. * * @since 1.0.0 * @access public * @return void */ protected function render_template() { ?>
  • {{ data.title }} <# if ( data.pro_text && data.pro_url ) { #> {{ data.pro_text }} <# } #>