| @@ -170,15 +170,15 @@ | ||
| 170 | 170 | * Adds the directives and layout needed for the lightbox behavior. |
| 171 | 171 | * |
| 172 | 172 | * @since 6.4.0 |
| 173 | 173 | * |
| 174 | - * @param string $block_content Rendered block content. | |
| 175 | - * @param array $block Block object. | |
| 176 | - * @param WP_Block $block_instance Block instance. | |
| 174 | + * @param string $block_content Rendered block content. | |
| 175 | + * @param array $block Block object. | |
| 176 | + * @param array $block_instance Block instance. | |
| 177 | 177 | * |
| 178 | 178 | * @return string Filtered block content. |
| 179 | 179 | */ |
| 180 | -function gutenberg_block_core_image_render_lightbox( $block_content, array $block, WP_Block $block_instance ) { | |
| 180 | +function gutenberg_block_core_image_render_lightbox( $block_content, $block, $block_instance ) { | |
| 181 | 181 | /* |
| 182 | 182 | * If there's no IMG tag in the block then return the given block content |
| 183 | 183 | * as-is. There's nothing that this code can knowingly modify to add the |
| 184 | 184 | * lightbox behavior. |
| @@ -204,10 +204,10 @@ | ||
| 204 | 204 | 'core/image', |
| 205 | 205 | array( |
| 206 | 206 | 'defaultAriaLabel' => __( 'Enlarged image' ), |
| 207 | 207 | 'closeButtonText' => esc_html__( 'Close' ), |
| 208 | - 'prevButtonText' => esc_html_x( 'Previous', 'previous image in lightbox' ), | |
| 209 | - 'nextButtonText' => esc_html_x( 'Next', 'next image in lightbox' ), | |
| 208 | + 'prevButtonText' => esc_html__( 'Previous' ), | |
| 209 | + 'nextButtonText' => esc_html__( 'Next' ), | |
| 210 | 210 | ) |
| 211 | 211 | ); |
| 212 | 212 | |
| 213 | 213 | if ( $alt ) { |
| @@ -249,9 +249,9 @@ | ||
| 249 | 249 | 'alt' => $alt, |
| 250 | 250 | 'galleryId' => $block_instance->context['galleryId'] ?? null, |
| 251 | 251 | 'customAriaLabel' => $custom_aria_label ?? null, |
| 252 | 252 | 'navigationButtonType' => $block_instance->context['navigationButtonType'] ?? 'icon', |
| 253 | - 'triggerButtonAriaLabel' => __( 'Enlarge' ), | |
| 253 | + 'triggerButtonAriaLabel' => null, | |
| 254 | 254 | ), |
| 255 | 255 | ), |
| 256 | 256 | ) |
| 257 | 257 | ); |
| @@ -322,10 +322,10 @@ | ||
| 322 | 322 | */ |
| 323 | 323 | function gutenberg_block_core_image_print_lightbox_overlay() { |
| 324 | 324 | $dialog_label = esc_attr__( 'Enlarged images' ); |
| 325 | 325 | $close_button_text = esc_attr__( 'Close' ); |
| 326 | - $prev_button_text = esc_attr_x( 'Previous', 'previous image in lightbox' ); | |
| 327 | - $next_button_text = esc_attr_x( 'Next', 'next image in lightbox' ); | |
| 326 | + $prev_button_text = esc_attr__( 'Previous' ); | |
| 327 | + $next_button_text = esc_attr__( 'Next' ); | |
| 328 | 328 | $close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"></path></svg>'; |
| 329 | 329 | $prev_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="28" height="28" aria-hidden="true" focusable="false"><path d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"></path></svg>'; |
| 330 | 330 | $next_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="28" height="28" aria-hidden="true" focusable="false"><path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"></path></svg>'; |
| 331 | 331 | |
| @@ -334,9 +334,9 @@ | ||
| 334 | 334 | // default values because it can't get them from the Global Styles. |
| 335 | 335 | $background_color = '#fff'; |
| 336 | 336 | $close_button_color = '#000'; |
| 337 | 337 | if ( wp_theme_has_theme_json() ) { |
| 338 | - $global_styles_color = gutenberg_get_global_styles( array( 'color' ) ); | |
| 338 | + $global_styles_color = wp_get_global_styles( array( 'color' ) ); | |
| 339 | 339 | if ( ! empty( $global_styles_color['background'] ) ) { |
| 340 | 340 | $background_color = esc_attr( $global_styles_color['background'] ); |
| 341 | 341 | } |
| 342 | 342 | if ( ! empty( $global_styles_color['text'] ) ) { |
| @@ -388,8 +388,9 @@ | ||
| 388 | 388 | data-wp-bind--alt="state.selectedImage.alt" |
| 389 | 389 | data-wp-bind--class="state.selectedImage.imgClassNames" |
| 390 | 390 | data-wp-bind--style="state.imgStyles" |
| 391 | 391 | data-wp-bind--src="state.enlargedSrc" |
| 392 | + data-wp-bind--srcset="state.enlargedSrcset" | |
| 392 | 393 | data-wp-bind--srcset="state.enlargedSrcset" |
| 393 | 394 | sizes="100vw" |
| 394 | 395 | > |
| 395 | 396 | </figure> |