validate_setting_values example

<?php     }

    /** * Prints JavaScript settings for preview frame. * * @since 3.4.0 */
    public function customize_preview_settings() {
        $post_values                 = $this->unsanitized_post_values( array( 'exclude_changeset' => true ) );
        $setting_validities          = $this->validate_setting_values( $post_values );
        $exported_setting_validities = array_map( array( $this, 'prepare_setting_validity_for_js' )$setting_validities );

        // Note that the REQUEST_URI is not passed into home_url() since this breaks subdirectory installations.         $self_url           = empty( $_SERVER['REQUEST_URI'] ) ? home_url( '/' ) : sanitize_url( wp_unslash( $_SERVER['REQUEST_URI'] ) );
        $state_query_params = array(
            'customize_theme',
            'customize_changeset_uuid',
            'customize_messenger_channel',
        );
        $self_url           = remove_query_arg( $state_query_params$self_url );

        

        do_action( 'customize_render_partials_after', $this$partials );

        $response = array(
            'contents' => $contents,
        );

        if ( defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY ) {
            $response['errors'] = $this->triggered_errors;
        }

        $setting_validities             = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );
        $exported_setting_validities    = array_map( array( $this->manager, 'prepare_setting_validity_for_js' )$setting_validities );
        $response['setting_validities'] = $exported_setting_validities;

        /** * Filters the response from rendering the partials. * * Plugins may use this filter to inject `$scripts` and `$styles`, which are dependencies * for the partials being rendered. The response data will be available to the client via * the `render-partials-response` JS event, so the client can then inject the scripts and * styles into the DOM if they have not already been enqueued there. * * If plugins do this, they'll need to take care for any scripts that do `document.write()` * and make sure that these are not injected, or else to override the function to no-op, * or else the page will be destroyed. * * Plugins should be aware that `$scripts` and `$styles` may eventually be included by * default in the response. * * @since 4.5.0 * * @param array $response { * Response. * * @type array $contents Associative array mapping a partial ID its corresponding array of contents * for the containers requested. * @type array $errors List of errors triggered during rendering of partials, if `WP_DEBUG_DISPLAY` * is enabled. * } * @param WP_Customize_Selective_Refresh $refresh Selective refresh component. * @param array $partials Placements' context data for the partials rendered in the request. * The array is keyed by partial ID, with each item being an array of * the placements' context data. */
Home | Imprint | This part of the site doesn't use cookies.