get_widget_preview example

$serialized_instance = serialize( $instance );
        $widget_key          = $wp_widget_factory->get_widget_key( $id );

        $response = array(
            'form'     => trim(
                $this->get_widget_form(
                    $widget_object,
                    $instance
                )
            ),
            'preview'  => trim(
                $this->get_widget_preview(
                    $widget_key,
                    $instance
                )
            ),
            'instance' => array(
                'encoded' => base64_encode( $serialized_instance ),
                'hash'    => wp_hash( $serialized_instance ),
            ),
        );

        if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) {
            
Home | Imprint | This part of the site doesn't use cookies.