wp_render_widget_control example

'instance'      => null,
        );

        if (
            rest_is_field_included( 'rendered', $fields ) &&
            'wp_inactive_widgets' !== $sidebar_id
        ) {
            $prepared['rendered'] = trim( wp_render_widget( $widget_id$sidebar_id ) );
        }

        if ( rest_is_field_included( 'rendered_form', $fields ) ) {
            $rendered_form = wp_render_widget_control( $widget_id );
            if ( ! is_null( $rendered_form ) ) {
                $prepared['rendered_form'] = trim( $rendered_form );
            }
        }

        if ( rest_is_field_included( 'instance', $fields ) ) {
            $widget_object = $wp_widget_factory->get_widget_object( $parsed_id['id_base'] );
            if ( $widget_object && isset( $parsed_id['number'] ) ) {
                $all_instances                   = $widget_object->get_settings();
                $instance                        = $all_instances[ $parsed_id['number'] ];
                $serialized_instance             = serialize( $instance );
                
Home | Imprint | This part of the site doesn't use cookies.