WP File Manager
Current Path:
/
www
/
htdocs
/
w0103d72
/
Kronauer-20191025
/
extranet
/
wp-includes
/
blocks
/
Name
Action
..
archives
archives.php
Edit
audio
avatar
avatar.php
Edit
block
block.php
Edit
blocks-json.php
Edit
button
button.php
Edit
buttons
calendar
calendar.php
Edit
categories
categories.php
Edit
code
column
columns
comment-author-name
comment-author-name.php
Edit
comment-content
comment-content.php
Edit
comment-date
comment-date.php
Edit
comment-edit-link
comment-edit-link.php
Edit
comment-reply-link
comment-reply-link.php
Edit
comment-template
comment-template.php
Edit
comments
comments-pagination
comments-pagination-next
comments-pagination-next.php
Edit
comments-pagination-numbers
comments-pagination-numbers.php
Edit
comments-pagination-previous
comments-pagination-previous.php
Edit
comments-pagination.php
Edit
comments-title
comments-title.php
Edit
comments.php
Edit
cover
cover.php
Edit
details
embed
file
file.php
Edit
footnotes
footnotes.php
Edit
freeform
gallery
gallery.php
Edit
group
heading
heading.php
Edit
home-link
home-link.php
Edit
html
image
image.php
Edit
index.php
Edit
latest-comments
latest-comments.php
Edit
latest-posts
latest-posts.php
Edit
legacy-widget
legacy-widget.php
Edit
list
list-item
list.php
Edit
loginout
loginout.php
Edit
media-text
media-text.php
Edit
missing
more
navigation
navigation-link
navigation-link.php
Edit
navigation-submenu
navigation-submenu.php
Edit
navigation.php
Edit
nextpage
page-list
page-list-item
page-list-item.php
Edit
page-list.php
Edit
paragraph
pattern
pattern.php
Edit
post-author
post-author-biography
post-author-biography.php
Edit
post-author-name
post-author-name.php
Edit
post-author.php
Edit
post-comments-form
post-comments-form.php
Edit
post-content
post-content.php
Edit
post-date
post-date.php
Edit
post-excerpt
post-excerpt.php
Edit
post-featured-image
post-featured-image.php
Edit
post-navigation-link
post-navigation-link.php
Edit
post-template
post-template.php
Edit
post-terms
post-terms.php
Edit
post-title
post-title.php
Edit
preformatted
pullquote
query
query-no-results
query-no-results.php
Edit
query-pagination
query-pagination-next
query-pagination-next.php
Edit
query-pagination-numbers
query-pagination-numbers.php
Edit
query-pagination-previous
query-pagination-previous.php
Edit
query-pagination.php
Edit
query-title
query-title.php
Edit
query.php
Edit
quote
read-more
read-more.php
Edit
require-dynamic-blocks.php
Edit
require-static-blocks.php
Edit
rss
rss.php
Edit
search
search.php
Edit
separator
shortcode
shortcode.php
Edit
site-logo
site-logo.php
Edit
site-tagline
site-tagline.php
Edit
site-title
site-title.php
Edit
social-link
social-link.php
Edit
social-links
spacer
table
tag-cloud
tag-cloud.php
Edit
template-part
template-part.php
Edit
term-description
term-description.php
Edit
text-columns
verse
video
widget-group
widget-group.php
Edit
Editing: post-navigation-link.php
<?php /** * Server-side rendering of the `core/post-navigation-link` block. * * @package WordPress */ /** * Renders the `core/post-navigation-link` block on the server. * * @since 5.9.0 * * @param array $attributes Block attributes. * @param string $content Block default content. * * @return string Returns the next or previous post link that is adjacent to the current post. */ function render_block_core_post_navigation_link( $attributes, $content ) { if ( ! is_singular() ) { return ''; } // Get the navigation type to show the proper link. Available options are `next|previous`. $navigation_type = isset( $attributes['type'] ) ? $attributes['type'] : 'next'; // Allow only `next` and `previous` in `$navigation_type`. if ( ! in_array( $navigation_type, array( 'next', 'previous' ), true ) ) { return ''; } $classes = "post-navigation-link-$navigation_type"; if ( isset( $attributes['textAlign'] ) ) { $classes .= " has-text-align-{$attributes['textAlign']}"; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes, ) ); // Set default values. $format = '%link'; $link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' ); $label = ''; // Only use hardcoded values here, otherwise we need to add escaping where these values are used. $arrow_map = array( 'none' => '', 'arrow' => array( 'next' => '→', 'previous' => '←', ), 'chevron' => array( 'next' => '»', 'previous' => '«', ), ); // If a custom label is provided, make this a link. // `$label` is used to prepend the provided label, if we want to show the page title as well. if ( isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ) { $label = "{$attributes['label']}"; $link = $label; } // If we want to also show the page title, make the page title a link and prepend the label. if ( isset( $attributes['showTitle'] ) && $attributes['showTitle'] ) { /* * If the label link option is not enabled but there is a custom label, * display the custom label as text before the linked title. */ if ( ! $attributes['linkLabel'] ) { if ( $label ) { $format = '<span class="post-navigation-link__label">' . wp_kses_post( $label ) . '</span> %link'; } $link = '%title'; } elseif ( isset( $attributes['linkLabel'] ) && $attributes['linkLabel'] ) { // If the label link option is enabled and there is a custom label, display it before the title. if ( $label ) { $link = '<span class="post-navigation-link__label">' . wp_kses_post( $label ) . '</span> <span class="post-navigation-link__title">%title</span>'; } else { /* * If the label link option is enabled and there is no custom label, * add a colon between the label and the post title. */ $label = 'next' === $navigation_type ? _x( 'Next:', 'label before the title of the next post' ) : _x( 'Previous:', 'label before the title of the previous post' ); $link = sprintf( '<span class="post-navigation-link__label">%1$s</span> <span class="post-navigation-link__title">%2$s</span>', wp_kses_post( $label ), '%title' ); } } } // Display arrows. if ( isset( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] && isset( $arrow_map[ $attributes['arrow'] ] ) ) { $arrow = $arrow_map[ $attributes['arrow'] ][ $navigation_type ]; if ( 'next' === $navigation_type ) { $format = '%link<span class="wp-block-post-navigation-link__arrow-next is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>'; } else { $format = '<span class="wp-block-post-navigation-link__arrow-previous is-arrow-' . $attributes['arrow'] . '" aria-hidden="true">' . $arrow . '</span>%link'; } } /* * The dynamic portion of the function name, `$navigation_type`, * Refers to the type of adjacency, 'next' or 'previous'. * * @see https://developer.wordpress.org/reference/functions/get_previous_post_link/ * @see https://developer.wordpress.org/reference/functions/get_next_post_link/ */ $get_link_function = "get_{$navigation_type}_post_link"; if ( ! empty( $attributes['taxonomy'] ) ) { $content = $get_link_function( $format, $link, true, '', $attributes['taxonomy'] ); } else { $content = $get_link_function( $format, $link ); } return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $content ); } /** * Registers the `core/post-navigation-link` block on the server. * * @since 5.9.0 */ function register_block_core_post_navigation_link() { register_block_type_from_metadata( __DIR__ . '/post-navigation-link', array( 'render_callback' => 'render_block_core_post_navigation_link', ) ); } add_action( 'init', 'register_block_core_post_navigation_link' );