- Timestamp:
- 09/26/2023 02:20:18 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/query-pagination-previous.php
r56065 r56710 16 16 */ 17 17 function render_block_core_query_pagination_previous( $attributes, $content, $block ) { 18 $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; 19 $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; 18 $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; 19 $enhanced_pagination = isset( $block->context['enhancedPagination'] ) && $block->context['enhancedPagination']; 20 $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; 20 21 21 22 $wrapper_attributes = get_block_wrapper_attributes(); … … 35 36 // and handle appropriately. 36 37 if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { 37 $filter_link_attributes = static function () use ( $wrapper_attributes ) {38 $filter_link_attributes = static function () use ( $wrapper_attributes ) { 38 39 return $wrapper_attributes; 39 40 }; … … 50 51 ); 51 52 } 53 54 if ( $enhanced_pagination ) { 55 $p = new WP_HTML_Tag_Processor( $content ); 56 if ( $p->next_tag( 57 array( 58 'tag_name' => 'a', 59 'class_name' => 'wp-block-query-pagination-previous', 60 ) 61 ) ) { 62 $p->set_attribute( 'data-wp-key', 'query-pagination-previous' ); 63 $p->set_attribute( 'data-wp-on--click', 'actions.core.query.navigate' ); 64 $p->set_attribute( 'data-wp-on--mouseenter', 'actions.core.query.prefetch' ); 65 $p->set_attribute( 'data-wp-effect', 'effects.core.query.prefetch' ); 66 $content = $p->get_updated_html(); 67 } 68 } 69 52 70 return $content; 53 71 }
Note: See TracChangeset
for help on using the changeset viewer.