7.4.33 | Linux x86_64
Server128.199.10.0
Userwww-data (uid:33)
PHP7.4.33 (apache2handler)
Terminal
Upload
Files: /var/www/html/wp-includes/blocks
View: query-pagination-previous.php
<?php /** * Server-side rendering of the `core/query-pagination-previous` block. * * @package WordPress */ /** * Renders the `core/query-pagination-previous` block on the server. * * @since 5.8.0 * * @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 = (bool) ( $block->context['enhancedPagination'] ?? false ); $max_page = (int) ( $block->context['query']['pages'] ?? 0 ); $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; $wrapper_attributes = get_block_wrapper_attributes(); $show_label = (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 ); } else { $block_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) ); $block_max_pages = $block_query->max_num_pages; $total = ! $max_page || $max_page > $block_max_pages ? $block_max_pages : $max_page; wp_reset_postdata(); if ( 1 < $page && $page <= $total ) { $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', 'core/query::actions.navigate' ); $p->set_attribute( 'data-wp-on--mouseenter', 'core/query::actions.prefetch' ); $p->set_attribute( 'data-wp-watch', 'core/query::callbacks.prefetch' ); $content = $p->get_updated_html(); } } return $content; } /** * Registers the `core/query-pagination-previous` block on the server. * * @since 5.8.0 */ 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' );
NameSizeActions
accordion/--
accordion-heading/--
accordion-item/--
accordion-item.php3KView Edit Del
accordion-panel/--
accordion.php1.1KView Edit Del
archives/--
archives.php4.3KView Edit Del
audio/--
avatar/--
avatar.php5.5KView Edit Del
block/--
block.php4.1KView Edit Del
blocks-json.php194.5KView Edit Del
breadcrumbs/--
breadcrumbs.php18.6KView Edit Del
button/--
button.php1.7KView Edit Del
buttons/--
calendar/--
calendar.php5.9KView Edit Del
categories/--
categories.php4.8KView Edit Del
code/--
column/--
columns/--
comment-author-name/--
comment-author-name.php2.1KView Edit Del
comment-content/--
comment-content.php2.4KView Edit Del
comment-date/--
comment-date.php1.8KView Edit Del
comment-edit-link/--
comment-edit-link.php1.7KView Edit Del
comment-reply-link/--
comment-reply-link.php2KView Edit Del
comment-template/--
comment-template.php4.4KView Edit Del
comments/--
comments-pagination/--
comments-pagination-next/--
comments-pagination-next.php1.9KView Edit Del
comments-pagination-numbers/--
comments-pagination-numbers.php1.6KView Edit Del
comments-pagination-previous/--
comments-pagination-previous.php1.7KView Edit Del
comments-pagination.php1.2KView Edit Del
comments-title/--
comments-title.php2.7KView Edit Del
comments.php6.6KView Edit Del
cover/--
cover.php7.2KView Edit Del
details/--
details.php1.5KView Edit Del
embed/--
file/--
file.php1.8KView Edit Del
footnotes/--
footnotes.php3.7KView Edit Del
freeform/--
gallery/--
gallery.php8.9KView Edit Del
group/--
heading/--
heading.php1.3KView Edit Del
home-link/--
home-link.php5.3KView Edit Del
html/--
icon/--
icon.php4KView Edit Del
image/--
image.php17.2KView Edit Del
index.php5KView Edit Del
latest-comments/--
latest-comments.php5.4KView Edit Del
latest-posts/--
latest-posts.php8.6KView Edit Del
legacy-widget/--
legacy-widget.php3.9KView Edit Del
list/--
list-item/--
list.php1.2KView Edit Del
loginout/--
loginout.php1.6KView Edit Del
math/--
media-text/--
media-text.php4.2KView Edit Del
missing/--
more/--
navigation/--
navigation-link/--
navigation-link.php15.8KView Edit Del
navigation-overlay-close/--
navigation-overlay-close.php1.7KView Edit Del
navigation-submenu/--
navigation-submenu.php11.5KView Edit Del
navigation.php63.3KView Edit Del
nextpage/--
page-list/--
page-list-item/--
page-list-item.php361BView Edit Del
page-list.php14.7KView Edit Del
paragraph/--
paragraph.php1.1KView Edit Del
pattern/--
pattern.php1.7KView Edit Del
post-author/--
post-author-biography/--
post-author-biography.php1.5KView Edit Del
post-author-name/--
post-author-name.php1.9KView Edit Del
post-author.php2.7KView Edit Del
post-comments-count/--
post-comments-count.php1.2KView Edit Del
post-comments-form/--
post-comments-form.php2.7KView Edit Del
post-comments-link/--
post-comments-link.php2.2KView Edit Del
post-content/--
post-content.php2.3KView Edit Del
post-date/--
post-date.php3.6KView Edit Del
post-excerpt/--
post-excerpt.php4.2KView Edit Del
post-featured-image/--
post-featured-image.php9KView Edit Del
post-navigation-link/--
post-navigation-link.php4.7KView Edit Del
post-template/--
post-template.php5.6KView Edit Del
post-terms/--
post-terms.php3.6KView Edit Del
post-time-to-read/--
post-time-to-read.php6.3KView Edit Del
post-title/--
post-title.php2.1KView Edit Del
preformatted/--
pullquote/--
query/--
query-no-results/--
query-no-results.php1.8KView Edit Del
query-pagination/--
query-pagination-next/--
query-pagination-next.php3.6KView Edit Del
query-pagination-numbers/--
query-pagination-numbers.php4.6KView Edit Del
query-pagination-previous/--
query-pagination-previous.php3.4KView Edit Del
query-pagination.php1.1KView Edit Del
query-title/--
query-title.php2.7KView Edit Del
query-total/--
query-total.php2.4KView Edit Del
query.php5.6KView Edit Del
quote/--
read-more/--
read-more.php1.8KView Edit Del
require-dynamic-blocks.php4.9KView Edit Del
require-static-blocks.php520BView Edit Del
rss/--
rss.php4.5KView Edit Del
search/--
search.php23.3KView Edit Del
separator/--
shortcode/--
shortcode.php735BView Edit Del
site-logo/--
site-logo.php6.2KView Edit Del
site-tagline/--
site-tagline.php1.2KView Edit Del
site-title/--
site-title.php1.8KView Edit Del
social-link/--
social-link.php66KView Edit Del
social-links/--
spacer/--
table/--
tag-cloud/--
tag-cloud.php1.6KView Edit Del
template-part/--
template-part.php10.2KView Edit Del
term-count/--
term-count.php1.8KView Edit Del
term-description/--
term-description.php1.7KView Edit Del
term-name/--
term-name.php2KView Edit Del
term-template/--
term-template.php4.4KView Edit Del
terms-query/--
text-columns/--
verse/--
video/--
video.php2.7KView Edit Del
widget-group/--
widget-group.php2.4KView Edit Del