choices ) ) { return; } $name = '_customize-radio-' . $this->id; ?> label ); ?> description ) ) : ?> description ); ?>
choices as $value => $label ) : ?> link(); checked( $this->value(), $value ); ?>>
'_customize-dropdown-categories-' . $this->id, 'echo' => 0, 'show_option_none' => __( '— Select —', 'belinni-lite' ), 'option_none_value' => '0', 'selected' => $this->value(), ) ); $dropdown = str_replace( 'get_link(), $dropdown ); printf( '', $this->label, $dropdown ); } } } /* * Sanitizations * */ /* Image sanitization callback example. */ function belinni_sanitize_image( $image, $setting ) { $mimes = array( 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => 'image/x-icon' ); $file = wp_check_filetype( $image, $mimes ); return ( $file['ext'] ? $image : $setting->default ); } /* Select sanitization callback */ function belinni_sanitize_select( $input, $setting ) { $input = sanitize_key( $input ); $choices = $setting->manager->get_control( $setting->id )->choices; return ( array_key_exists( $input, $choices ) ? $input : $setting->default ); } /* Checkbox sanitization callback */ function belinni_sanitize_checkbox( $checked ) { return ( ( isset( $checked ) && true == $checked ) ? true : false ); } /* Number sanitization callback */ function belinni_sanitize_number( $number, $setting ) { $number = absint( $number ); return ( $number ? $number : $setting->default ); } /* HEX Color sanitization callback */ function belinni_sanitize_hex_color( $color ) { if ( '' === $color ) { return ''; } if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) { return $color; } } /* No-HTML sanitization callback */ function belinni_sanitize_nohtml( $nohtml ) { return wp_filter_nohtml_kses( $nohtml ); } /* HTML sanitization callback */ function belinni_sanitize_html( $html ) { return wp_filter_post_kses( $html ); } /* CSS sanitization callback */ function belinni_sanitize_css( $css ) { return wp_strip_all_tags( $css ); } ?>