rebase on oct-10-2023
This commit is contained in:
@@ -20,10 +20,15 @@ function render_block_core_query_pagination_next( $attributes, $content, $block
|
||||
$max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0;
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes();
|
||||
$show_label = isset( $block->context['showLabel'] ) ? (bool) $block->context['showLabel'] : true;
|
||||
$default_label = __( 'Next Page' );
|
||||
$label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? esc_html( $attributes['label'] ) : $default_label;
|
||||
$label_text = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? esc_html( $attributes['label'] ) : $default_label;
|
||||
$label = $show_label ? $label_text : '';
|
||||
$pagination_arrow = get_query_pagination_arrow( $block, true );
|
||||
|
||||
if ( ! $label ) {
|
||||
$wrapper_attributes .= ' aria-label="' . $label_text . '"';
|
||||
}
|
||||
if ( $pagination_arrow ) {
|
||||
$label .= $pagination_arrow;
|
||||
}
|
||||
@@ -31,7 +36,7 @@ function render_block_core_query_pagination_next( $attributes, $content, $block
|
||||
|
||||
// Check if the pagination is for Query that inherits the global context.
|
||||
if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) {
|
||||
$filter_link_attributes = function() use ( $wrapper_attributes ) {
|
||||
$filter_link_attributes = static function() use ( $wrapper_attributes ) {
|
||||
return $wrapper_attributes;
|
||||
};
|
||||
add_filter( 'next_posts_link_attributes', $filter_link_attributes );
|
||||
|
||||
Reference in New Issue
Block a user