id;; $blog_vlog_dropdown_categories = wp_dropdown_categories( array( 'name' => $blog_vlog_customizer_name, 'echo' => 0, 'show_option_none' =>__('Select Category','blog-vlog'), 'option_none_value' => '0', 'selected' => $this->value(), ) ); $blog_vlog_dropdown_final = str_replace( 'get_link(), $blog_vlog_dropdown_categories ); printf( '', $this->label, $blog_vlog_dropdown_final ); } } endif; /** * Alpha Color Picker Customizer Control * * This control adds a second slider for opacity to the stock WordPress color picker, * and it includes logic to seamlessly convert between RGBa and Hex color values as * opacity is added to or removed from a color. * * This Alpha Color Picker is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this Alpha Color Picker. If not, see . */ class blog_vlog_Color_Control extends WP_Customize_Control { /** * Official control name. */ public $type = 'alpha-color'; /** * Add support for palettes to be passed in. * * Supported palette values are true, false, or an array of RGBa and Hex colors. */ public $palette; /** * Add support for showing the opacity value on the slider handle. */ public $show_opacity; /** * Enqueue scripts and styles. * * Ideally these would get registered and given proper paths before this control object * gets initialized, then we could simply enqueue them here, but for completeness as a * stand alone class we'll register and enqueue them here. */ /** * Render the control. */ public function render_content() { // Process the palette if ( is_array( $this->palette ) ) { $palette = implode( '|', $this->palette ); } else { // Default to true. $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; } // Support passing show_opacity as string or boolean. Default to true. $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; // Begin the output. ?>
esc_html__('Show', 'blog-vlog'), 'hide' => esc_html__('Hide', 'blog-vlog') ); return apply_filters('blog_vlog_slider_option', $blog_vlog_slider_option); } endif; /** * Sanitizing the select callback example * * @since 1.0.0 * * @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 $input * @param $setting * @return sanitized output */ if ( !function_exists('blog_vlog_sanitize_select') ) : function blog_vlog_sanitize_select( $input, $setting ) { // Ensure input is a slug. $input = sanitize_text_field( $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 ); } endif;