Title: WP_REST_Global_Styles_Controller::__construct
Published: February 3, 2022
Last modified: February 24, 2026

---

# WP_REST_Global_Styles_Controller::__construct( string $post_type )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#wp--skip-link--target)

Constructor.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#parameters)󠁿

 `$post_type`stringrequired

Post type.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#source)󠁿

    ```php
    public function __construct( $post_type = 'wp_global_styles' ) {
    	parent::__construct( $post_type );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php#L29)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php#L29-L31)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_REST_Posts_Controller::__construct()](https://developer.wordpress.org/reference/classes/wp_rest_posts_controller/__construct/)`wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php` |

Constructor.

  |

| Used by | Description | 
| [WP_REST_Global_Styles_Revisions_Controller::__construct()](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_revisions_controller/__construct/)`wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php` |

Constructor.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_rest_global_styles_controller/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.6.0](https://developer.wordpress.org/reference/since/6.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_rest_global_styles_controller%2F__construct%2F)
before being able to contribute a note or feedback.