label ) ) { ?> label ); ?> description ) ) { ?> description ); ?> value() ) ); ?> link(); ?> /> choices as $key => $value ) { ?>
label ) ) { ?> label ); ?> description ) ) { ?> description ); ?>
choices as $key => $value ) { ?>
label ) ) { ?> label ); ?> description ) ) { ?> description ); ?> choices as $key => $value ) { ?>
array( 'href' => array(), 'title' => array(), 'class' => array(), 'target' => array(), ), 'br' => array(), 'em' => array(), 'strong' => array(), 'i' => array( 'class' => array() ), 'span' => array( 'class' => array(), ), 'code' => array(), ); ?>
label ) ) { ?> label ); ?> description ) ) { ?> description, $allowed_html ); ?>
label ); ?>link(); ?> />
link(); checked( $this->value() ); ?>>
label ); ?> description ) ) { ?> description ); ?>
button_labels = wp_parse_args( $this->button_labels, array( 'add' => esc_html__( 'Add', 'alpert' ), ) ); } /** * Render the control in the customizer */ public function render_content() { ?>
label ) ) { ?> label ); ?> description ) ) { ?> description ); ?> link(); ?> />
input_attrs['multiselect'] ) && $this->input_attrs['multiselect'] ) { $this->multiselect = true; } // Check if a placeholder string has been specified if ( isset( $this->input_attrs['placeholder'] ) && $this->input_attrs['placeholder'] ) { $this->placeholder = $this->input_attrs['placeholder']; } } /** * Render the control in the customizer */ public function render_content() { $defaultValue = $this->value(); if ( $this->multiselect ) { $defaultValue = explode( ',', $this->value() ); } ?> posts = Alpert_Customizer_Utilities::get_posts_as_array( $this->input_attrs ); } /** * Render the control in the customizer */ public function render_content() { ?> json['alperttinymcetoolbar1'] = isset( $this->input_attrs['toolbar1'] ) ? esc_attr( $this->input_attrs['toolbar1'] ) : 'bold italic bullist numlist alignleft aligncenter alignright link'; $this->json['alperttinymcetoolbar2'] = isset( $this->input_attrs['toolbar2'] ) ? esc_attr( $this->input_attrs['toolbar2'] ) : ''; $this->json['alpertmediabuttons'] = isset( $this->input_attrs['mediaButtons'] ) && ( $this->input_attrs['mediaButtons'] === true ) ? true : false; } /** * Render the control in the customizer */ public function render_content(){ ?>
label ); ?> description ) ) { ?> description ); ?>

' . wp_kses_post( $this->label ) . '

'; } } /** * Upsell section * */ class Alpert_Upsell_Section extends WP_Customize_Section { /** * The type of control being rendered */ public $type = 'alpert_alpert-upsell'; /** * The Upsell URL */ public $url = ''; /** * The background color for the control */ public $backgroundcolor = ''; /** * The text color for the control */ public $textcolor = ''; /** * Render the section, and the controls that have been added to it. */ protected function render() { $bkgrndcolor = !empty( $this->backgroundcolor ) ? esc_attr( $this->backgroundcolor ) : '#fff'; $color = !empty( $this->textcolor ) ? esc_attr( $this->textcolor ) : '#555d66'; ?>
  • > >title ); ?>

  • $value) { $input[$key] = esc_url_raw( $value ); } $input = implode( ',', $input ); } else { $input = esc_url_raw( $input ); } return $input; } } /** * Switch sanitization * * @param string Switch value * @return integer Sanitized value */ if ( ! function_exists( 'alpert_switch_sanitization' ) ) { function alpert_switch_sanitization( $input ) { if ( true === $input ) { return 1; } else { return 0; } } } /** * Radio Button and Select sanitization * * @param string Radio Button value * @return integer Sanitized value */ if ( ! function_exists( 'alpert_radio_sanitization' ) ) { function alpert_radio_sanitization( $input, $setting ) { //get the list of possible radio box or select options $choices = $setting->manager->get_control( $setting->id )->choices; if ( array_key_exists( $input, $choices ) ) { return $input; } else { return $setting->default; } } } /** * Text sanitization * * @param string Input to be sanitized * @return string Sanitized input */ if ( ! function_exists( 'alpert_text_sanitization' ) ) { function alpert_text_sanitization( $input ) { return sanitize_text_field( $input ); } } /** * Select sanitization callback example. * * - Sanitization: select * - Control: select, radio * * Sanitization callback for 'select' and 'radio' type controls. This callback sanitizes `$input` * as a slug, and then validates `$input` against the choices defined for the control. * * @see sanitize_key() https://developer.wordpress.org/reference/functions/sanitize_key/ * @see $wp_customize->get_control() https://developer.wordpress.org/reference/classes/wp_customize_manager/get_control/ * * @param string $input Slug to sanitize. * @param WP_Customize_Setting $setting Setting instance. * @return string Sanitized slug if it is a valid choice; otherwise, the setting default. */ function alpert_sanitize_select( $input, $setting ) { // Ensure input is a slug. $input = sanitize_key( $input ); // Get list of choices from the control associated with the setting. $choices = $setting->manager->get_control( $setting->id )->choices; // If the input is a valid key, return it; otherwise, return the default. return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } }