]. * @param array $args The arguments. * * @return string */ public function filter_preferred_choice_setting( $setting, $choice, $args ) { // Fail early. if ( ! isset( $args[ $setting ] ) ) { return ''; } if ( null === $choice ) { $per_choice_found = false; foreach ( $args['choices'] as $choice_id => $choice_label ) { if ( isset( $args[ $setting ][ $choice_id ] ) ) { $per_choice_found = true; break; } } if ( ! $per_choice_found ) { return $args[ $setting ]; } return ''; } // If a specific field for the choice is set. if ( isset( $args[ $setting ][ $choice ] ) ) { return $args[ $setting ][ $choice ]; } // Unset all other choices. foreach ( $args['choices'] as $id => $set ) { if ( $id !== $choice && isset( $args[ $setting ][ $id ] ) ) { unset( $args[ $setting ][ $id ] ); } elseif ( ! isset( $args[ $setting ][ $id ] ) ) { $args[ $setting ] = ''; } } return $args[ $setting ]; } /** * Filter arguments before creating the setting. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_setting_args( $args, $wp_customize ) { if ( $args['settings'] !== $this->args['settings'] ) { return $args; } // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = [ __CLASS__, 'sanitize' ]; } return $args; } /** * Sanitizes background controls * * @static * @access public * @since 1.0 * @param array $value The value. * @return array */ public static function sanitize( $value ) { foreach ( $value as $key => $subvalue ) { $value[ $key ] = \Kirki\Field\Color::sanitize( $subvalue ); } return $value; } /** * Override parent method. No need to register any setting. * * @access public * @since 0.1 * @param WP_Customize_Manager $wp_customize The customizer instance. * @return void */ public function add_setting( $wp_customize ) {} /** * Override the parent method. No need for a control. * * @access public * @since 0.1 * @param WP_Customize_Manager $wp_customize The customizer instance. * @return void */ public function add_control( $wp_customize ) {} /** * Adds a custom output class for typography fields. * * @access public * @since 1.0 * @param array $classnames The array of classnames. * @return array */ public function output_control_classnames( $classnames ) { $classnames['kirki-multicolor'] = '\Kirki\Field\CSS\Multicolor'; return $classnames; } }
Warning: session_start(): Session cannot be started after headers have already been sent in /htdocs/wp-content/plugins/shipping-rate-by-cities/shipping_rate_by_cities.php on line 106
Archives des En vedette - SOUTRAMARKET