partials example

add_action( 'wp_footer', array( $this, 'export_preview_data' ), 1000 );
    }

    /** * Exports data in preview after it has finished rendering so that partials can be added at runtime. * * @since 4.5.0 */
    public function export_preview_data() {
        $partials = array();

        foreach ( $this->partials() as $partial ) {
            if ( $partial->check_capabilities() ) {
                $partials[ $partial->id ] = $partial->json();
            }
        }

        $switched_locale = switch_to_user_locale( get_current_user_id() );
        $l10n            = array(
            'shiftClickToEdit' => __( 'Shift-click to edit this element.' ),
            'clickEditMenu'    => __( 'Click to edit this menu.' ),
            'clickEditWidget'  => __( 'Click to edit this widget.' ),
            'clickEditTitle'   => __( 'Click to edit the site title.' ),
            
Home | Imprint | This part of the site doesn't use cookies.