WP_Theme_JSON_Resolver::get_user_global_styles_post_id(): integer|null
- Since
- 5.9.0
- Source
wp-includes/class-wp-theme-json-resolver.php:686
Returns the ID of the custom post type that stores user data.
Return
integer|null
Uses · 2
- wp_get_theme()Gets a WP_Theme object for a theme.
- static::get_user_data_from_wp_global_styles()
Used by · 1
- WP_REST_Themes_Controller::prepare_links()Prepares links for the request.
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.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Return type changed from
integer|null to int|null.verified against source5.9.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 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.