Changeset 55216 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 02/03/2023 06:23:55 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r55192 r55216 1008 1008 1009 1009 /** 1010 * Processes the CSS, to apply nesting. 1011 * 1012 * @since 6.2.0 1013 * 1014 * @param string $css The CSS to process. 1015 * @param string $selector The selector to nest. 1016 * @return string The processed CSS. 1017 */ 1018 protected function process_blocks_custom_css( $css, $selector ) { 1019 $processed_css = ''; 1020 1021 // Split CSS nested rules. 1022 $parts = explode( '&', $css ); 1023 foreach ( $parts as $part ) { 1024 $processed_css .= ( ! str_contains( $part, '{' ) ) 1025 ? trim( $selector ) . '{' . trim( $part ) . '}' // If the part doesn't contain braces, it applies to the root level. 1026 : trim( $selector . $part ); // Prepend the selector, which effectively replaces the "&" character. 1027 } 1028 return $processed_css; 1029 } 1030 1031 /** 1010 1032 * Returns the global styles custom css. 1011 1033 * 1012 1034 * @since 6.2.0 1013 1035 * 1014 * @return string 1036 * @return string The global styles custom CSS. 1015 1037 */ 1016 1038 public function get_custom_css() {
Note: See TracChangeset
for help on using the changeset viewer.