Make WordPress Core

Changeset 56575


Ignore:
Timestamp:
09/14/2023 05:11:50 AM (6 months ago)
Author:
isabel_brison
Message:

REST API: quality tweaks to WP_REST_Global_Styles_Controller.

Removes redundant local variable and changes validate_custom_css() access modifier from private to protected.

Props ramonopoly, spacedmonkey.
Fixes #59296.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php

    r56193 r56575  
    664664     *
    665665     * @since 6.0.0
     666     * @since 6.2.0 Returns parent theme variations, if they exist.
    666667     *
    667668     * @param WP_REST_Request $request The request instance.
     
    680681
    681682        $variations = WP_Theme_JSON_Resolver::get_style_variations();
    682         $response   = rest_ensure_response( $variations );
    683 
    684         return $response;
     683
     684        return rest_ensure_response( $variations );
    685685    }
    686686
     
    691691     *
    692692     * @since 6.2.0
     693     * @since 6.4.0 Changed method visibility to protected.
    693694     *
    694695     * @param string $css CSS to validate.
    695696     * @return true|WP_Error True if the input was validated, otherwise WP_Error.
    696697     */
    697     private function validate_custom_css( $css ) {
     698    protected function validate_custom_css( $css ) {
    698699        if ( preg_match( '#</?\w+#', $css ) ) {
    699700            return new WP_Error(
Note: See TracChangeset for help on using the changeset viewer.