diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:56:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:56:49 +0000 |
commit | a415c29efee45520ae252d2aa28f1083a521cd7b (patch) | |
tree | f4ade4b6668ecc0765de7e1424f7c1427ad433ff /wp-includes/blocks/query-pagination | |
parent | Initial commit. (diff) | |
download | wordpress-a415c29efee45520ae252d2aa28f1083a521cd7b.tar.xz wordpress-a415c29efee45520ae252d2aa28f1083a521cd7b.zip |
Adding upstream version 6.4.3+dfsg1.upstream/6.4.3+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
20 files changed, 670 insertions, 0 deletions
diff --git a/wp-includes/blocks/query-pagination-next.php b/wp-includes/blocks/query-pagination-next.php new file mode 100644 index 0000000..768fde5 --- /dev/null +++ b/wp-includes/blocks/query-pagination-next.php @@ -0,0 +1,96 @@ +<?php +/** + * Server-side rendering of the `core/query-pagination-next` block. + * + * @package WordPress + */ + +/** + * Renders the `core/query-pagination-next` block on the server. + * + * @param array $attributes Block attributes. + * @param string $content Block default content. + * @param WP_Block $block Block instance. + * + * @return string Returns the next posts link for the query pagination. + */ +function render_block_core_query_pagination_next( $attributes, $content, $block ) { + $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $enhanced_pagination = isset( $block->context['enhancedPagination'] ) && $block->context['enhancedPagination']; + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + $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_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; + } + $content = ''; + + // 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 = static function () use ( $wrapper_attributes ) { + return $wrapper_attributes; + }; + add_filter( 'next_posts_link_attributes', $filter_link_attributes ); + // Take into account if we have set a bigger `max page` + // than what the query has. + global $wp_query; + if ( $max_page > $wp_query->max_num_pages ) { + $max_page = $wp_query->max_num_pages; + } + $content = get_next_posts_link( $label, $max_page ); + remove_filter( 'next_posts_link_attributes', $filter_link_attributes ); + } elseif ( ! $max_page || $max_page > $page ) { + $custom_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) ); + $custom_query_max_pages = (int) $custom_query->max_num_pages; + if ( $custom_query_max_pages && $custom_query_max_pages !== $page ) { + $content = sprintf( + '<a href="%1$s" %2$s>%3$s</a>', + esc_url( add_query_arg( $page_key, $page + 1 ) ), + $wrapper_attributes, + $label + ); + } + wp_reset_postdata(); // Restore original Post Data. + } + + if ( $enhanced_pagination && isset( $content ) ) { + $p = new WP_HTML_Tag_Processor( $content ); + if ( $p->next_tag( + array( + 'tag_name' => 'a', + 'class_name' => 'wp-block-query-pagination-next', + ) + ) ) { + $p->set_attribute( 'data-wp-key', 'query-pagination-next' ); + $p->set_attribute( 'data-wp-on--click', 'actions.core.query.navigate' ); + $p->set_attribute( 'data-wp-on--mouseenter', 'actions.core.query.prefetch' ); + $p->set_attribute( 'data-wp-effect', 'effects.core.query.prefetch' ); + $content = $p->get_updated_html(); + } + } + + return $content; +} + +/** + * Registers the `core/query-pagination-next` block on the server. + */ +function register_block_core_query_pagination_next() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-next', + array( + 'render_callback' => 'render_block_core_query_pagination_next', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_next' ); diff --git a/wp-includes/blocks/query-pagination-next/block.json b/wp-includes/blocks/query-pagination-next/block.json new file mode 100644 index 0000000..95b1169 --- /dev/null +++ b/wp-includes/blocks/query-pagination-next/block.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination-next", + "title": "Next Page", + "category": "theme", + "parent": [ "core/query-pagination" ], + "description": "Displays the next posts page link.", + "textdomain": "default", + "attributes": { + "label": { + "type": "string" + } + }, + "usesContext": [ + "queryId", + "query", + "paginationArrow", + "showLabel", + "enhancedPagination" + ], + "supports": { + "reusable": false, + "html": false, + "color": { + "gradients": true, + "text": false, + "__experimentalDefaultControls": { + "background": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + } + } +} diff --git a/wp-includes/blocks/query-pagination-numbers.php b/wp-includes/blocks/query-pagination-numbers.php new file mode 100644 index 0000000..9809853 --- /dev/null +++ b/wp-includes/blocks/query-pagination-numbers.php @@ -0,0 +1,124 @@ +<?php +/** + * Server-side rendering of the `core/query-pagination-numbers` block. + * + * @package WordPress + */ + +/** + * Renders the `core/query-pagination-numbers` block on the server. + * + * @param array $attributes Block attributes. + * @param string $content Block default content. + * @param WP_Block $block Block instance. + * + * @return string Returns the pagination numbers for the Query. + */ +function render_block_core_query_pagination_numbers( $attributes, $content, $block ) { + $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $enhanced_pagination = isset( $block->context['enhancedPagination'] ) && $block->context['enhancedPagination']; + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + $max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0; + + $wrapper_attributes = get_block_wrapper_attributes(); + $content = ''; + global $wp_query; + $mid_size = isset( $block->attributes['midSize'] ) ? (int) $block->attributes['midSize'] : null; + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + // Take into account if we have set a bigger `max page` + // than what the query has. + $total = ! $max_page || $max_page > $wp_query->max_num_pages ? $wp_query->max_num_pages : $max_page; + $paginate_args = array( + 'prev_next' => false, + 'total' => $total, + ); + if ( null !== $mid_size ) { + $paginate_args['mid_size'] = $mid_size; + } + $content = paginate_links( $paginate_args ); + } else { + $block_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) ); + // `paginate_links` works with the global $wp_query, so we have to + // temporarily switch it with our custom query. + $prev_wp_query = $wp_query; + $wp_query = $block_query; + $total = ! $max_page || $max_page > $wp_query->max_num_pages ? $wp_query->max_num_pages : $max_page; + $paginate_args = array( + 'base' => '%_%', + 'format' => "?$page_key=%#%", + 'current' => max( 1, $page ), + 'total' => $total, + 'prev_next' => false, + ); + if ( null !== $mid_size ) { + $paginate_args['mid_size'] = $mid_size; + } + if ( 1 !== $page ) { + /** + * `paginate_links` doesn't use the provided `format` when the page is `1`. + * This is great for the main query as it removes the extra query params + * making the URL shorter, but in the case of multiple custom queries is + * problematic. It results in returning an empty link which ends up with + * a link to the current page. + * + * A way to address this is to add a `fake` query arg with no value that + * is the same for all custom queries. This way the link is not empty and + * preserves all the other existent query args. + * + * @see https://developer.wordpress.org/reference/functions/paginate_links/ + * + * The proper fix of this should be in core. Track Ticket: + * @see https://core.trac.wordpress.org/ticket/53868 + * + * TODO: After two WP versions (starting from the WP version the core patch landed), + * we should remove this and call `paginate_links` with the proper new arg. + */ + $paginate_args['add_args'] = array( 'cst' => '' ); + } + // We still need to preserve `paged` query param if exists, as is used + // for Queries that inherit from global context. + $paged = empty( $_GET['paged'] ) ? null : (int) $_GET['paged']; + if ( $paged ) { + $paginate_args['add_args'] = array( 'paged' => $paged ); + } + $content = paginate_links( $paginate_args ); + wp_reset_postdata(); // Restore original Post Data. + $wp_query = $prev_wp_query; + } + + if ( empty( $content ) ) { + return ''; + } + + if ( $enhanced_pagination ) { + $p = new WP_HTML_Tag_Processor( $content ); + while ( $p->next_tag( + array( + 'tag_name' => 'a', + 'class_name' => 'page-numbers', + ) + ) ) { + $p->set_attribute( 'data-wp-on--click', 'actions.core.query.navigate' ); + } + $content = $p->get_updated_html(); + } + + return sprintf( + '<div %1$s>%2$s</div>', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/query-pagination-numbers` block on the server. + */ +function register_block_core_query_pagination_numbers() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-numbers', + array( + 'render_callback' => 'render_block_core_query_pagination_numbers', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_numbers' ); diff --git a/wp-includes/blocks/query-pagination-numbers/block.json b/wp-includes/blocks/query-pagination-numbers/block.json new file mode 100644 index 0000000..f05e269 --- /dev/null +++ b/wp-includes/blocks/query-pagination-numbers/block.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination-numbers", + "title": "Page Numbers", + "category": "theme", + "parent": [ "core/query-pagination" ], + "description": "Displays a list of page numbers for pagination", + "textdomain": "default", + "attributes": { + "midSize": { + "type": "number", + "default": 2 + } + }, + "usesContext": [ "queryId", "query", "enhancedPagination" ], + "supports": { + "reusable": false, + "html": false, + "color": { + "gradients": true, + "text": false, + "__experimentalDefaultControls": { + "background": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + } + }, + "editorStyle": "wp-block-query-pagination-numbers-editor" +} diff --git a/wp-includes/blocks/query-pagination-numbers/editor-rtl.css b/wp-includes/blocks/query-pagination-numbers/editor-rtl.css new file mode 100644 index 0000000..cbebc0f --- /dev/null +++ b/wp-includes/blocks/query-pagination-numbers/editor-rtl.css @@ -0,0 +1,9 @@ +.wp-block-query-pagination-numbers a{ + text-decoration:underline; +} +.wp-block-query-pagination-numbers .page-numbers{ + margin-left:2px; +} +.wp-block-query-pagination-numbers .page-numbers:last-child{ + margin-right:0; +}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination-numbers/editor-rtl.min.css b/wp-includes/blocks/query-pagination-numbers/editor-rtl.min.css new file mode 100644 index 0000000..ef698af --- /dev/null +++ b/wp-includes/blocks/query-pagination-numbers/editor-rtl.min.css @@ -0,0 +1 @@ +.wp-block-query-pagination-numbers a{text-decoration:underline}.wp-block-query-pagination-numbers .page-numbers{margin-left:2px}.wp-block-query-pagination-numbers .page-numbers:last-child{margin-right:0}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination-numbers/editor.css b/wp-includes/blocks/query-pagination-numbers/editor.css new file mode 100644 index 0000000..3a5e4ba --- /dev/null +++ b/wp-includes/blocks/query-pagination-numbers/editor.css @@ -0,0 +1,9 @@ +.wp-block-query-pagination-numbers a{ + text-decoration:underline; +} +.wp-block-query-pagination-numbers .page-numbers{ + margin-right:2px; +} +.wp-block-query-pagination-numbers .page-numbers:last-child{ + margin-right:0; +}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination-numbers/editor.min.css b/wp-includes/blocks/query-pagination-numbers/editor.min.css new file mode 100644 index 0000000..9b7081c --- /dev/null +++ b/wp-includes/blocks/query-pagination-numbers/editor.min.css @@ -0,0 +1 @@ +.wp-block-query-pagination-numbers a{text-decoration:underline}.wp-block-query-pagination-numbers .page-numbers{margin-right:2px}.wp-block-query-pagination-numbers .page-numbers:last-child{margin-right:0}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination-previous.php b/wp-includes/blocks/query-pagination-previous.php new file mode 100644 index 0000000..fc1fee0 --- /dev/null +++ b/wp-includes/blocks/query-pagination-previous.php @@ -0,0 +1,84 @@ +<?php +/** + * Server-side rendering of the `core/query-pagination-previous` block. + * + * @package WordPress + */ + +/** + * Renders the `core/query-pagination-previous` block on the server. + * + * @param array $attributes Block attributes. + * @param string $content Block default content. + * @param WP_Block $block Block instance. + * + * @return string Returns the previous posts link for the query. + */ +function render_block_core_query_pagination_previous( $attributes, $content, $block ) { + $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; + $enhanced_pagination = isset( $block->context['enhancedPagination'] ) && $block->context['enhancedPagination']; + $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; + + $wrapper_attributes = get_block_wrapper_attributes(); + $show_label = isset( $block->context['showLabel'] ) ? (bool) $block->context['showLabel'] : true; + $default_label = __( 'Previous Page' ); + $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, false ); + if ( ! $label ) { + $wrapper_attributes .= ' aria-label="' . $label_text . '"'; + } + if ( $pagination_arrow ) { + $label = $pagination_arrow . $label; + } + $content = ''; + // Check if the pagination is for Query that inherits the global context + // and handle appropriately. + if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { + $filter_link_attributes = static function () use ( $wrapper_attributes ) { + return $wrapper_attributes; + }; + + add_filter( 'previous_posts_link_attributes', $filter_link_attributes ); + $content = get_previous_posts_link( $label ); + remove_filter( 'previous_posts_link_attributes', $filter_link_attributes ); + } elseif ( 1 !== $page ) { + $content = sprintf( + '<a href="%1$s" %2$s>%3$s</a>', + esc_url( add_query_arg( $page_key, $page - 1 ) ), + $wrapper_attributes, + $label + ); + } + + if ( $enhanced_pagination && isset( $content ) ) { + $p = new WP_HTML_Tag_Processor( $content ); + if ( $p->next_tag( + array( + 'tag_name' => 'a', + 'class_name' => 'wp-block-query-pagination-previous', + ) + ) ) { + $p->set_attribute( 'data-wp-key', 'query-pagination-previous' ); + $p->set_attribute( 'data-wp-on--click', 'actions.core.query.navigate' ); + $p->set_attribute( 'data-wp-on--mouseenter', 'actions.core.query.prefetch' ); + $p->set_attribute( 'data-wp-effect', 'effects.core.query.prefetch' ); + $content = $p->get_updated_html(); + } + } + + return $content; +} + +/** + * Registers the `core/query-pagination-previous` block on the server. + */ +function register_block_core_query_pagination_previous() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination-previous', + array( + 'render_callback' => 'render_block_core_query_pagination_previous', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination_previous' ); diff --git a/wp-includes/blocks/query-pagination-previous/block.json b/wp-includes/blocks/query-pagination-previous/block.json new file mode 100644 index 0000000..fbaac54 --- /dev/null +++ b/wp-includes/blocks/query-pagination-previous/block.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination-previous", + "title": "Previous Page", + "category": "theme", + "parent": [ "core/query-pagination" ], + "description": "Displays the previous posts page link.", + "textdomain": "default", + "attributes": { + "label": { + "type": "string" + } + }, + "usesContext": [ + "queryId", + "query", + "paginationArrow", + "showLabel", + "enhancedPagination" + ], + "supports": { + "reusable": false, + "html": false, + "color": { + "gradients": true, + "text": false, + "__experimentalDefaultControls": { + "background": true + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + } + } +} diff --git a/wp-includes/blocks/query-pagination.php b/wp-includes/blocks/query-pagination.php new file mode 100644 index 0000000..9b7289e --- /dev/null +++ b/wp-includes/blocks/query-pagination.php @@ -0,0 +1,47 @@ +<?php +/** + * Server-side rendering of the `core/query-pagination` block. + * + * @package WordPress + */ + +/** + * Renders the `core/query-pagination` block on the server. + * + * @param array $attributes Block attributes. + * @param string $content Block default content. + * + * @return string Returns the wrapper for the Query pagination. + */ +function render_block_core_query_pagination( $attributes, $content ) { + if ( empty( trim( $content ) ) ) { + return ''; + } + + $classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : ''; + $wrapper_attributes = get_block_wrapper_attributes( + array( + 'aria-label' => __( 'Pagination' ), + 'class' => $classes, + ) + ); + + return sprintf( + '<nav %1$s>%2$s</nav>', + $wrapper_attributes, + $content + ); +} + +/** + * Registers the `core/query-pagination` block on the server. + */ +function register_block_core_query_pagination() { + register_block_type_from_metadata( + __DIR__ . '/query-pagination', + array( + 'render_callback' => 'render_block_core_query_pagination', + ) + ); +} +add_action( 'init', 'register_block_core_query_pagination' ); diff --git a/wp-includes/blocks/query-pagination/block.json b/wp-includes/blocks/query-pagination/block.json new file mode 100644 index 0000000..e32a9ba --- /dev/null +++ b/wp-includes/blocks/query-pagination/block.json @@ -0,0 +1,61 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "core/query-pagination", + "title": "Pagination", + "category": "theme", + "parent": [ "core/query" ], + "description": "Displays a paginated navigation to next/previous set of posts, when applicable.", + "textdomain": "default", + "attributes": { + "paginationArrow": { + "type": "string", + "default": "none" + }, + "showLabel": { + "type": "boolean", + "default": true + } + }, + "usesContext": [ "queryId", "query" ], + "providesContext": { + "paginationArrow": "paginationArrow", + "showLabel": "showLabel" + }, + "supports": { + "align": true, + "reusable": false, + "html": false, + "color": { + "gradients": true, + "link": true, + "__experimentalDefaultControls": { + "background": true, + "text": true, + "link": true + } + }, + "layout": { + "allowSwitching": false, + "allowInheriting": false, + "default": { + "type": "flex" + } + }, + "typography": { + "fontSize": true, + "lineHeight": true, + "__experimentalFontFamily": true, + "__experimentalFontWeight": true, + "__experimentalFontStyle": true, + "__experimentalTextTransform": true, + "__experimentalTextDecoration": true, + "__experimentalLetterSpacing": true, + "__experimentalDefaultControls": { + "fontSize": true + } + } + }, + "editorStyle": "wp-block-query-pagination-editor", + "style": "wp-block-query-pagination" +} diff --git a/wp-includes/blocks/query-pagination/editor-rtl.css b/wp-includes/blocks/query-pagination/editor-rtl.css new file mode 100644 index 0000000..7f72d3c --- /dev/null +++ b/wp-includes/blocks/query-pagination/editor-rtl.css @@ -0,0 +1,19 @@ +.wp-block[data-align=center]>.wp-block-query-pagination{ + justify-content:center; +} + +.editor-styles-wrapper .wp-block-query-pagination{ + max-width:100%; +} +.editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout{ + margin:0; +} + +.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{ + margin-bottom:.5em; + margin-right:.5em; + margin-top:.5em; +} +.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{ + margin-right:0; +}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination/editor-rtl.min.css b/wp-includes/blocks/query-pagination/editor-rtl.min.css new file mode 100644 index 0000000..52af693 --- /dev/null +++ b/wp-includes/blocks/query-pagination/editor-rtl.min.css @@ -0,0 +1 @@ +.wp-block[data-align=center]>.wp-block-query-pagination{justify-content:center}.editor-styles-wrapper .wp-block-query-pagination{max-width:100%}.editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout{margin:0}.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin-bottom:.5em;margin-right:.5em;margin-top:.5em}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination/editor.css b/wp-includes/blocks/query-pagination/editor.css new file mode 100644 index 0000000..0ad7b63 --- /dev/null +++ b/wp-includes/blocks/query-pagination/editor.css @@ -0,0 +1,17 @@ +.wp-block[data-align=center]>.wp-block-query-pagination{ + justify-content:center; +} + +.editor-styles-wrapper .wp-block-query-pagination{ + max-width:100%; +} +.editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout{ + margin:0; +} + +.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{ + margin:.5em .5em .5em 0; +} +.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{ + margin-right:0; +}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination/editor.min.css b/wp-includes/blocks/query-pagination/editor.min.css new file mode 100644 index 0000000..ca79311 --- /dev/null +++ b/wp-includes/blocks/query-pagination/editor.min.css @@ -0,0 +1 @@ +.wp-block[data-align=center]>.wp-block-query-pagination{justify-content:center}.editor-styles-wrapper .wp-block-query-pagination{max-width:100%}.editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout{margin:0}.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin:.5em .5em .5em 0}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination/style-rtl.css b/wp-includes/blocks/query-pagination/style-rtl.css new file mode 100644 index 0000000..886dd36 --- /dev/null +++ b/wp-includes/blocks/query-pagination/style-rtl.css @@ -0,0 +1,32 @@ +.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{ + margin-bottom:.5em; + margin-right:.5em; +} +.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{ + margin-right:0; +} +.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-next:last-of-type{ + -webkit-margin-start:auto; + margin-inline-start:auto; +} +.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-previous:first-child{ + -webkit-margin-end:auto; + margin-inline-end:auto; +} +.wp-block-query-pagination .wp-block-query-pagination-previous-arrow{ + display:inline-block; + margin-left:1ch; +} +.wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron){ + transform:scaleX(-1);; +} +.wp-block-query-pagination .wp-block-query-pagination-next-arrow{ + display:inline-block; + margin-right:1ch; +} +.wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron){ + transform:scaleX(-1);; +} +.wp-block-query-pagination.aligncenter{ + justify-content:center; +}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination/style-rtl.min.css b/wp-includes/blocks/query-pagination/style-rtl.min.css new file mode 100644 index 0000000..79c2bf0 --- /dev/null +++ b/wp-includes/blocks/query-pagination/style-rtl.min.css @@ -0,0 +1 @@ +.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin-bottom:.5em;margin-right:.5em}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-next:last-of-type{-webkit-margin-start:auto;margin-inline-start:auto}.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-previous:first-child{-webkit-margin-end:auto;margin-inline-end:auto}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow{display:inline-block;margin-left:1ch}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-query-pagination .wp-block-query-pagination-next-arrow{display:inline-block;margin-right:1ch}.wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-query-pagination.aligncenter{justify-content:center}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination/style.css b/wp-includes/blocks/query-pagination/style.css new file mode 100644 index 0000000..79f6c2c --- /dev/null +++ b/wp-includes/blocks/query-pagination/style.css @@ -0,0 +1,32 @@ +.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{ + margin-bottom:.5em; + margin-right:.5em; +} +.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{ + margin-right:0; +} +.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-next:last-of-type{ + -webkit-margin-start:auto; + margin-inline-start:auto; +} +.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-previous:first-child{ + -webkit-margin-end:auto; + margin-inline-end:auto; +} +.wp-block-query-pagination .wp-block-query-pagination-previous-arrow{ + display:inline-block; + margin-right:1ch; +} +.wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron){ + transform:scaleX(1); +} +.wp-block-query-pagination .wp-block-query-pagination-next-arrow{ + display:inline-block; + margin-left:1ch; +} +.wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron){ + transform:scaleX(1); +} +.wp-block-query-pagination.aligncenter{ + justify-content:center; +}
\ No newline at end of file diff --git a/wp-includes/blocks/query-pagination/style.min.css b/wp-includes/blocks/query-pagination/style.min.css new file mode 100644 index 0000000..cd42648 --- /dev/null +++ b/wp-includes/blocks/query-pagination/style.min.css @@ -0,0 +1 @@ +.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin-bottom:.5em;margin-right:.5em}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-next:last-of-type{-webkit-margin-start:auto;margin-inline-start:auto}.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-previous:first-child{-webkit-margin-end:auto;margin-inline-end:auto}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow{display:inline-block;margin-right:1ch}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-query-pagination .wp-block-query-pagination-next-arrow{display:inline-block;margin-left:1ch}.wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-query-pagination.aligncenter{justify-content:center}
\ No newline at end of file |