WP_Theme_JSON_Resolver::get_user_global_styles_post_id() WordPress Method

The WP_Theme_JSON_Resolver::get_user_global_styles_post_id() method is used to get the post ID of the global stylesheet for a user.

WP_Theme_JSON_Resolver::get_user_global_styles_post_id() #

Returns the ID of the custom post type that stores user data.


Return

(integer|null)


Top ↑

Source

File: wp-includes/class-wp-theme-json-resolver.php

	public static function get_user_global_styles_post_id() {
		if ( null !== static::$user_custom_post_type_id ) {
			return static::$user_custom_post_type_id;
		}

		$user_cpt = static::get_user_data_from_wp_global_styles( wp_get_theme(), true );

		if ( array_key_exists( 'ID', $user_cpt ) ) {
			static::$user_custom_post_type_id = $user_cpt['ID'];
		}

		return static::$user_custom_post_type_id;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.