Make WordPress Core


Ignore:
Timestamp:
09/26/2023 02:20:18 PM (3 years ago)
Author:
karmatosed
Message:

Update editor related npm packages

The npm packages needed updating for 6.4 to the latest.

Props mikachan, mukesdpanchal27, luisherranz, youknowriad, tellthemachines, gziolo, ockham, michalczaplinski

Fixes #59411

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/query-pagination-previous.php

    r56065 r56710  
    1616 */
    1717function 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 ];
    2021
    2122        $wrapper_attributes = get_block_wrapper_attributes();
    … …  
    3536        // and handle appropriately.
    3637        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 ) {
    3839                        return $wrapper_attributes;
    3940                };
    … …  
    5051                );
    5152        }
     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
    5270        return $content;
    5371}
Note: See TracChangeset for help on using the changeset viewer.