Applies if `prettify` is `true`. Default 0. * @return string The CSS declarations. */ public function get_declarations_string( $should_prettify = false, $indent_count = 0 ) { $declarations_array = $this->get_declarations(); $declarations_output = ''; $indent = $should_prettify ? str_repeat( "\t", $indent_count ) : ''; $suffix = $should_prettify ? ' ' : ''; $suffix = $should_prettify && $indent_count > 0 ? "\n" : $suffix; $spacer = $should_prettify ? ' ' : ''; foreach ( $declarations_array as $property => $value ) { $filtered_declaration = static::filter_declaration( $property, $value, $spacer ); if ( $filtered_declaration ) { $declarations_output .= "{$indent}{$filtered_declaration};$suffix"; } } return rtrim( $declarations_output ); } /** * Sanitizes property names. * * @since 6.1.0 * * @param string $property The CSS property. * @return string The sanitized property name. */ protected function sanitize_property( $property ) { return sanitize_key( $property ); } } nd . '-' . wp_json_encode( $args ) . '-' . $method ); $cache = $this->get_cache( $key ); if ( $cache ) { return $cache; } $this->run_server(); $controller_instance = $this->find_controller_instance( $command ); if ( ! $controller_instance ) { $this->set_cache( $key, [] ); return []; } $extracted_command = $this->command_extract_args( $command, $args ); $command = $extracted_command->command; $args = $extracted_command->args; $format = isset( $this->command_formats[ $command ] ) ? $this->command_formats[ $command ] : false; $command_processors = $controller_instance->get_processors( $command ); $endpoint = $this->command_to_endpoint( $command, $format, $args ); $this->run_processors( $command_processors, Processor\Before::class, [ $args ] ); $response = $this->run_request( $endpoint, $args, $method ); $result = $response->get_data(); if ( $response->is_error() ) { $this->set_cache( $key, [] ); return []; } $result = $this->run_processors( $command_processors, Processor\After::class, [ $args, $result ] ); $this->set_cache( $key, $result ); return $result; } public function is_internal() { return $this->is_internal; } }