Changeset 51051 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 06/01/2021 08:07:07 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r51007 r51051 611 611 612 612 /** 613 * Function that appends a sub-selector to a existing one. 614 * 615 * Given the compounded $selector "h1, h2, h3" 616 * and the $to_append selector ".some-class" the result will be 617 * "h1.some-class, h2.some-class, h3.some-class". 618 * 619 * @param string $selector Original selector. 620 * @param string $to_append Selector to append. 621 * 622 * @return string 623 */ 624 private static function append_to_selector( $selector, $to_append ) { 625 $new_selectors = array(); 626 $selectors = explode( ',', $selector ); 627 foreach ( $selectors as $sel ) { 628 $new_selectors[] = $sel . $to_append; 629 } 630 631 return implode( ',', $new_selectors ); 632 } 633 634 /** 613 635 * Given a settings array, it returns the generated rulesets 614 636 * for the preset classes. … … 634 656 foreach ( $preset['classes'] as $class ) { 635 657 $stylesheet .= self::to_ruleset( 636 $selector . '.has-' . $value['slug'] . '-' . $class['class_suffix'],658 self::append_to_selector( $selector, '.has-' . $value['slug'] . '-' . $class['class_suffix'] ), 637 659 array( 638 660 array(
Note: See TracChangeset
for help on using the changeset viewer.