Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync minor code quality tweaks to WP_REST_Global_Styles_Controller #5152

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ public function get_theme_items_permissions_check( $request ) { // phpcs:ignore
* Returns the given theme global styles variations.
*
* @since 6.0.0
* @since 6.2.0 Returns parent theme variations, if they exist.
* @since 6.4.0 Removed unnecessary local variable.
ramonjd marked this conversation as resolved.
Show resolved Hide resolved
*
* @param WP_REST_Request $request The request instance.
*
Expand All @@ -679,9 +681,8 @@ public function get_theme_items( $request ) {
}

$variations = WP_Theme_JSON_Resolver::get_style_variations();
$response = rest_ensure_response( $variations );

return $response;
return rest_ensure_response( $variations );
}

/**
Expand All @@ -690,11 +691,12 @@ public function get_theme_items( $request ) {
* Currently just checks for invalid markup.
*
* @since 6.2.0
* @since 6.4.0 Changed method visibility to protected.
*
* @param string $css CSS to validate.
* @return true|WP_Error True if the input was validated, otherwise WP_Error.
*/
private function validate_custom_css( $css ) {
protected function validate_custom_css( $css ) {
if ( preg_match( '#</?\w+#', $css ) ) {
return new WP_Error(
'rest_custom_css_illegal_markup',
Expand Down