get_user_global_styles_post_id example

$links = array(
            'self'       => array(
                'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $theme->get_stylesheet() ) ),
            ),
            'collection' => array(
                'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
            ),
        );

        if ( $this->is_same_theme( $themewp_get_theme() ) ) {
            // This creates a record for the active theme if not existent.             $id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id();
        } else {
            $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme );
            $id       = isset( $user_cpt['ID'] ) ? $user_cpt['ID'] : null;
        }

        if ( $id ) {
            $links['https://api.w.org/user-global-styles'] = array(
                'href' => rest_url( 'wp/v2/global-styles/' . $id ),
            );
        }

        
$custom_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered( true );

$editor_settings = get_block_editor_settings( $custom_settings$block_editor_context );

if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) {
    $post_type = get_post_type_object( $_GET['postType'] );
    if ( ! $post_type ) {
        wp_die( __( 'Invalid post type.' ) );
    }
}

$active_global_styles_id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id();
$active_theme            = get_stylesheet();

$navigation_rest_route = rest_get_route_for_post_type_items(
    'wp_navigation'
);

$preload_paths = array(
    array( '/wp/v2/media', 'OPTIONS' ),
    '/wp/v2/types?context=view',
    '/wp/v2/types/wp_template?context=edit',
    '/wp/v2/types/wp_template-part?context=edit',
    
Home | Imprint | This part of the site doesn't use cookies.