Changeset 58797 for trunk/src/wp-includes/block-supports/background.php
- Timestamp:
- 07/24/2024 12:24:31 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/background.php
r58222 r58797 63 63 } 64 64 65 $background_styles = array(); 66 $background_styles['backgroundImage'] = isset( $block_attributes['style']['background']['backgroundImage'] ) ? $block_attributes['style']['background']['backgroundImage'] : array(); 65 $background_styles = array(); 66 $background_styles['backgroundImage'] = $block_attributes['style']['background']['backgroundImage'] ?? null; 67 $background_styles['backgroundSize'] = $block_attributes['style']['background']['backgroundSize'] ?? null; 68 $background_styles['backgroundPosition'] = $block_attributes['style']['background']['backgroundPosition'] ?? null; 69 $background_styles['backgroundRepeat'] = $block_attributes['style']['background']['backgroundRepeat'] ?? null; 67 70 68 71 if ( ! empty( $background_styles['backgroundImage'] ) ) { 69 $background_styles['backgroundSize'] = isset( $block_attributes['style']['background']['backgroundSize'] ) ? $block_attributes['style']['background']['backgroundSize'] : 'cover'; 70 $background_styles['backgroundPosition'] = isset( $block_attributes['style']['background']['backgroundPosition'] ) ? $block_attributes['style']['background']['backgroundPosition'] : null; 71 $background_styles['backgroundRepeat'] = isset( $block_attributes['style']['background']['backgroundRepeat'] ) ? $block_attributes['style']['background']['backgroundRepeat'] : null; 72 $background_styles['backgroundSize'] = $background_styles['backgroundSize'] ?? 'cover'; 72 73 73 74 // If the background size is set to `contain` and no position is set, set the position to `center`.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)