is_render_partials_request example


    public function start_dynamic_sidebar( $index ) {
        array_unshift( $this->current_dynamic_sidebar_id_stack, $index );
        if ( ! isset( $this->sidebar_instance_count[ $index ] ) ) {
            $this->sidebar_instance_count[ $index ] = 0;
        }
        $this->sidebar_instance_count[ $index ] += 1;
        if ( ! $this->manager->selective_refresh->is_render_partials_request() ) {
            printf( "\n<!--dynamic_sidebar_before:%s:%d-->\n", esc_html( $index )(int) $this->sidebar_instance_count[ $index ] );
        }
    }

    /** * Finishes keeping track of the current sidebar being rendered. * * Inserts a marker after widgets are rendered in a dynamic sidebar. * * @since 4.5.0 * * @param int|string $index Index, name, or ID of the dynamic sidebar. */
'error_line'   => $errline,
        );
        return true;
    }

    /** * Handles the Ajax request to return the rendered partials for the requested placements. * * @since 4.5.0 */
    public function handle_render_partials_request() {
        if ( ! $this->is_render_partials_request() ) {
            return;
        }

        /* * Note that is_customize_preview() returning true will entail that the * user passed the 'customize' capability check and the nonce check, since * WP_Customize_Manager::setup_theme() is where the previewing flag is set. */
        if ( ! is_customize_preview() ) {
            wp_send_json_error( 'expected_customize_preview', 403 );
        } elseif ( ! isset( $_POST['partials'] ) ) {
            
Home | Imprint | This part of the site doesn't use cookies.