- Timestamp:
- 11/08/2021 02:26:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/query-pagination-numbers.php
r51051 r52042 46 46 'prev_next' => false, 47 47 ); 48 if ( 1 !== $page ) { 49 /** 50 * `paginate_links` doesn't use the provided `format` when the page is `1`. 51 * This is great for the main query as it removes the extra query params 52 * making the URL shorter, but in the case of multiple custom queries is 53 * problematic. It results in returning an empty link which ends up with 54 * a link to the current page. 55 * 56 * A way to address this is to add a `fake` query arg with no value that 57 * is the same for all custom queries. This way the link is not empty and 58 * preserves all the other existent query args. 59 * 60 * @see https://developer.wordpress.org/reference/functions/paginate_links/ 61 * 62 * The proper fix of this should be in core. Track Ticket: 63 * @see https://core.trac.wordpress.org/ticket/53868 64 * 65 * TODO: After two WP versions (starting from the WP version the core patch landed), 66 * we should remove this and call `paginate_links` with the proper new arg. 67 */ 68 $paginate_args['add_args'] = array( 'cst' => '' ); 69 } 48 70 // We still need to preserve `paged` query param if exists, as is used 49 71 // for Queries that inherit from global context.
Note: See TracChangeset
for help on using the changeset viewer.