wppaste
WordPress

WP_Theme_JSON_Resolver::get_user_global_styles_post_id(): int|null

Since
5.9.0
Source
wp-includes/class-wp-theme-json-resolver.php:678
Returns the ID of the custom post type that stores user data.

Return

int|null
ID for a post of type wp_global_styles, or null if not available.

Uses · 2

  • wp_get_theme()Gets a WP_Theme object for a theme.
  • static::get_user_data_from_wp_global_styles()

Used by · 1

Source

	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;	}

History

Introduced in 5.9.0. One change between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

7.0.4
Return type changed from integer|null to int|null.verified against source
5.9.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/class-wp-theme-json-resolver.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.