Priority File Manager

๐Ÿ“ public_html
Base Directory:
/home/ecedu/public_html/wp-includes/blocks
NameTypeSizeActions
๐Ÿ“ .. Folder -
๐Ÿ“ archives Folder -
๐Ÿ“„ archives.php File 2994
Edit Download
๐Ÿ“ audio Folder -
๐Ÿ“ avatar Folder -
๐Ÿ“„ avatar.php File 5745
Edit Download
๐Ÿ“ block Folder -
๐Ÿ“„ block.php File 3314
Edit Download
๐Ÿ“„ blocks-json.php File 193945
Edit Download
๐Ÿ“ button Folder -
๐Ÿ“„ button.php File 1805
Edit Download
๐Ÿ“ buttons Folder -
๐Ÿ“ calendar Folder -
๐Ÿ“„ calendar.php File 6075
Edit Download
๐Ÿ“ categories Folder -
๐Ÿ“„ categories.php File 4010
Edit Download
๐Ÿ“ code Folder -
๐Ÿ“ column Folder -
๐Ÿ“ columns Folder -
๐Ÿ“ comment-author-name Folder -
๐Ÿ“„ comment-author-name.php File 2133
Edit Download
๐Ÿ“ comment-content Folder -
๐Ÿ“„ comment-content.php File 2459
Edit Download
๐Ÿ“ comment-date Folder -
๐Ÿ“„ comment-date.php File 1863
Edit Download
๐Ÿ“ comment-edit-link Folder -
๐Ÿ“„ comment-edit-link.php File 1713
Edit Download
๐Ÿ“ comment-reply-link Folder -
๐Ÿ“„ comment-reply-link.php File 2075
Edit Download
๐Ÿ“ comment-template Folder -
๐Ÿ“„ comment-template.php File 4494
Edit Download
๐Ÿ“ comments Folder -
๐Ÿ“ comments-pagination Folder -
๐Ÿ“ comments-pagination-next Folder -
๐Ÿ“„ comments-pagination-next.php File 1924
Edit Download
๐Ÿ“ comments-pagination-numbers Folder -
๐Ÿ“„ comments-pagination-numbers.php File 1632
Edit Download
๐Ÿ“ comments-pagination-previous Folder -
๐Ÿ“„ comments-pagination-previous.php File 1790
Edit Download
๐Ÿ“„ comments-pagination.php File 1199
Edit Download
๐Ÿ“ comments-title Folder -
๐Ÿ“„ comments-title.php File 2772
Edit Download
๐Ÿ“„ comments.php File 6767
Edit Download
๐Ÿ“ cover Folder -
๐Ÿ“„ cover.php File 3175
Edit Download
๐Ÿ“ details Folder -
๐Ÿ“ embed Folder -
๐Ÿ“ file Folder -
๐Ÿ“„ file.php File 1793
Edit Download
๐Ÿ“ footnotes Folder -
๐Ÿ“„ footnotes.php File 3771
Edit Download
๐Ÿ“ freeform Folder -
๐Ÿ“ gallery Folder -
๐Ÿ“„ gallery.php File 6438
Edit Download
๐Ÿ“ group Folder -
๐Ÿ“ heading Folder -
๐Ÿ“„ heading.php File 1301
Edit Download
๐Ÿ“ home-link Folder -
๐Ÿ“„ home-link.php File 5438
Edit Download
๐Ÿ“ html Folder -
๐Ÿ“ image Folder -
๐Ÿ“„ image.php File 12023
Edit Download
๐Ÿ“„ index.php File 5111
Edit Download
๐Ÿ“ latest-comments Folder -
๐Ÿ“„ latest-comments.php File 5040
Edit Download
๐Ÿ“ latest-posts Folder -
๐Ÿ“„ latest-posts.php File 8542
Edit Download
๐Ÿ“ legacy-widget Folder -
๐Ÿ“„ legacy-widget.php File 3997
Edit Download
๐Ÿ“ list Folder -
๐Ÿ“ list-item Folder -
๐Ÿ“„ list.php File 1273
Edit Download
๐Ÿ“ loginout Folder -
๐Ÿ“„ loginout.php File 1418
Edit Download
๐Ÿ“ media-text Folder -
๐Ÿ“„ media-text.php File 4383
Edit Download
๐Ÿ“ missing Folder -
๐Ÿ“ more Folder -
๐Ÿ“ navigation Folder -
๐Ÿ“ navigation-link Folder -
๐Ÿ“„ navigation-link.php File 13913
Edit Download
๐Ÿ“ navigation-submenu Folder -
๐Ÿ“„ navigation-submenu.php File 9943
Edit Download
๐Ÿ“„ navigation.php File 49620
Edit Download
๐Ÿ“ nextpage Folder -
๐Ÿ“ page-list Folder -
๐Ÿ“ page-list-item Folder -
๐Ÿ“„ page-list-item.php File 361
Edit Download
๐Ÿ“„ page-list.php File 13611
Edit Download
๐Ÿ“ paragraph Folder -
๐Ÿ“ pattern Folder -
๐Ÿ“„ pattern.php File 1788
Edit Download
๐Ÿ“ post-author Folder -
๐Ÿ“ post-author-biography Folder -
๐Ÿ“„ post-author-biography.php File 1524
Edit Download
๐Ÿ“ post-author-name Folder -
๐Ÿ“„ post-author-name.php File 1951
Edit Download
๐Ÿ“„ post-author.php File 2734
Edit Download
๐Ÿ“ post-comments-form Folder -
๐Ÿ“„ post-comments-form.php File 2805
Edit Download
๐Ÿ“ post-content Folder -
๐Ÿ“„ post-content.php File 2156
Edit Download
๐Ÿ“ post-date Folder -
๐Ÿ“„ post-date.php File 3124
Edit Download
๐Ÿ“ post-excerpt Folder -
๐Ÿ“„ post-excerpt.php File 3447
Edit Download
๐Ÿ“ post-featured-image Folder -
๐Ÿ“„ post-featured-image.php File 9363
Edit Download
๐Ÿ“ post-navigation-link Folder -
๐Ÿ“„ post-navigation-link.php File 4837
Edit Download
๐Ÿ“ post-template Folder -
๐Ÿ“„ post-template.php File 5749
Edit Download
๐Ÿ“ post-terms Folder -
๐Ÿ“„ post-terms.php File 3640
Edit Download
๐Ÿ“ post-title Folder -
๐Ÿ“„ post-title.php File 2138
Edit Download
๐Ÿ“ preformatted Folder -
๐Ÿ“ pullquote Folder -
๐Ÿ“ query Folder -
๐Ÿ“ query-no-results Folder -
๐Ÿ“„ query-no-results.php File 1847
Edit Download
๐Ÿ“ query-pagination Folder -
๐Ÿ“ query-pagination-next Folder -
๐Ÿ“„ query-pagination-next.php File 3787
Edit Download
๐Ÿ“ query-pagination-numbers Folder -
๐Ÿ“„ query-pagination-numbers.php File 4770
Edit Download
๐Ÿ“ query-pagination-previous Folder -
๐Ÿ“„ query-pagination-previous.php File 3584
Edit Download
๐Ÿ“„ query-pagination.php File 1176
Edit Download
๐Ÿ“ query-title Folder -
๐Ÿ“„ query-title.php File 2098
Edit Download
๐Ÿ“ query-total Folder -
๐Ÿ“„ query-total.php File 2535
Edit Download
๐Ÿ“„ query.php File 5690
Edit Download
๐Ÿ“ quote Folder -
๐Ÿ“ read-more Folder -
๐Ÿ“„ read-more.php File 1830
Edit Download
๐Ÿ“„ require-dynamic-blocks.php File 4163
Edit Download
๐Ÿ“„ require-static-blocks.php File 501
Edit Download
๐Ÿ“ rss Folder -
๐Ÿ“„ rss.php File 4073
Edit Download
๐Ÿ“ search Folder -
๐Ÿ“„ search.php File 23016
Edit Download
๐Ÿ“ separator Folder -
๐Ÿ“ shortcode Folder -
๐Ÿ“„ shortcode.php File 735
Edit Download
๐Ÿ“ site-logo Folder -
๐Ÿ“„ site-logo.php File 6334
Edit Download
๐Ÿ“ site-tagline Folder -
๐Ÿ“„ site-tagline.php File 1203
Edit Download
๐Ÿ“ site-title Folder -
๐Ÿ“„ site-title.php File 1853
Edit Download
๐Ÿ“ social-link Folder -
๐Ÿ“„ social-link.php File 65174
Edit Download
๐Ÿ“ social-links Folder -
๐Ÿ“ spacer Folder -
๐Ÿ“ table Folder -
๐Ÿ“ tag-cloud Folder -
๐Ÿ“„ tag-cloud.php File 1590
Edit Download
๐Ÿ“ template-part Folder -
๐Ÿ“„ template-part.php File 10154
Edit Download
๐Ÿ“ term-description Folder -
๐Ÿ“„ term-description.php File 1336
Edit Download
๐Ÿ“ text-columns Folder -
๐Ÿ“ verse Folder -
๐Ÿ“ video Folder -
๐Ÿ“ widget-group Folder -
๐Ÿ“„ widget-group.php File 2438
Edit Download

View File: 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' );