summaryrefslogtreecommitdiffstats
path: root/wp-includes/blocks/query-pagination-numbers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-includes/blocks/query-pagination-numbers
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/6.5+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--wp-includes/blocks/query-pagination-numbers.php15
-rw-r--r--wp-includes/blocks/query-pagination-numbers/block.json5
2 files changed, 13 insertions, 7 deletions
diff --git a/wp-includes/blocks/query-pagination-numbers.php b/wp-includes/blocks/query-pagination-numbers.php
index 9809853..e6f8b46 100644
--- a/wp-includes/blocks/query-pagination-numbers.php
+++ b/wp-includes/blocks/query-pagination-numbers.php
@@ -91,14 +91,17 @@ function render_block_core_query_pagination_numbers( $attributes, $content, $blo
}
if ( $enhanced_pagination ) {
- $p = new WP_HTML_Tag_Processor( $content );
+ $p = new WP_HTML_Tag_Processor( $content );
+ $tag_index = 0;
while ( $p->next_tag(
- array(
- 'tag_name' => 'a',
- 'class_name' => 'page-numbers',
- )
+ array( 'class_name' => 'page-numbers' )
) ) {
- $p->set_attribute( 'data-wp-on--click', 'actions.core.query.navigate' );
+ if ( null === $p->get_attribute( 'data-wp-key' ) ) {
+ $p->set_attribute( 'data-wp-key', 'index-' . $tag_index++ );
+ }
+ if ( 'A' === $p->get_tag() ) {
+ $p->set_attribute( 'data-wp-on--click', 'core/query::actions.navigate' );
+ }
}
$content = $p->get_updated_html();
}
diff --git a/wp-includes/blocks/query-pagination-numbers/block.json b/wp-includes/blocks/query-pagination-numbers/block.json
index f05e269..8a9f0ee 100644
--- a/wp-includes/blocks/query-pagination-numbers/block.json
+++ b/wp-includes/blocks/query-pagination-numbers/block.json
@@ -5,7 +5,7 @@
"title": "Page Numbers",
"category": "theme",
"parent": [ "core/query-pagination" ],
- "description": "Displays a list of page numbers for pagination",
+ "description": "Displays a list of page numbers for pagination.",
"textdomain": "default",
"attributes": {
"midSize": {
@@ -36,6 +36,9 @@
"__experimentalDefaultControls": {
"fontSize": true
}
+ },
+ "interactivity": {
+ "clientNavigation": true
}
},
"editorStyle": "wp-block-query-pagination-numbers-editor"