$14 GRAYBYTE WORDPRESS FILE MANAGER $46

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 93.127.173.129 | ADMIN IP 216.73.216.21
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/u550391411/domains/kunaldryfruites.com/public_html/wp-includes/blocks/

HOME
Current File : /home/u550391411/domains/kunaldryfruites.com/public_html/wp-includes/blocks//post-template.php
<?php
/**
 * Server-side rendering of the `core/post-template` block.
 *
 * @package WordPress
 */

/**
 * Determines whether a block list contains a block that uses the featured image.
 *
 * @param WP_Block_List $inner_blocks Inner block instance.
 *
 * @return bool Whether the block list contains a block that uses the featured image.
 */
function block_core_post_template_uses_featured_image( $inner_blocks ) {
	foreach ( $inner_blocks as $block ) {
		if ( 'core/post-featured-image' === $block->name ) {
			return true;
		}
		if (
			'core/cover' === $block->name &&
			! empty( $block->attributes['useFeaturedImage'] )
		) {
			return true;
		}
		if ( $block->inner_blocks && block_core_post_template_uses_featured_image( $block->inner_blocks ) ) {
			return true;
		}
	}

	return false;
}

/**
 * Renders the `core/post-template` block on the server.
 *
 * @since 6.3.0 Changed render_block_context priority to `1`.
 *
 * @param array    $attributes Block attributes.
 * @param string   $content    Block default content.
 * @param WP_Block $block      Block instance.
 *
 * @return string Returns the output of the query, structured using the layout defined by the block's inner blocks.
 */
function render_block_core_post_template( $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 ];

	// Use global query if needed.
	$use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] );
	if ( $use_global_query ) {
		global $wp_query;

		/*
		 * If already in the main query loop, duplicate the query instance to not tamper with the main instance.
		 * Since this is a nested query, it should start at the beginning, therefore rewind posts.
		 * Otherwise, the main query loop has not started yet and this block is responsible for doing so.
		 */
		if ( in_the_loop() ) {
			$query = clone $wp_query;
			$query->rewind_posts();
		} else {
			$query = $wp_query;
		}
	} else {
		$query_args = build_query_vars_from_query_block( $block, $page );
		$query      = new WP_Query( $query_args );
	}

	if ( ! $query->have_posts() ) {
		return '';
	}

	if ( block_core_post_template_uses_featured_image( $block->inner_blocks ) ) {
		update_post_thumbnail_cache( $query );
	}

	$classnames = '';
	if ( isset( $block->context['displayLayout'] ) && isset( $block->context['query'] ) ) {
		if ( isset( $block->context['displayLayout']['type'] ) && 'flex' === $block->context['displayLayout']['type'] ) {
			$classnames = "is-flex-container columns-{$block->context['displayLayout']['columns']}";
		}
	}
	if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
		$classnames .= ' has-link-color';
	}

	// Ensure backwards compatibility by flagging the number of columns via classname when using grid layout.
	if ( isset( $attributes['layout']['type'] ) && 'grid' === $attributes['layout']['type'] && ! empty( $attributes['layout']['columnCount'] ) ) {
		$classnames .= ' ' . sanitize_title( 'columns-' . $attributes['layout']['columnCount'] );
	}

	$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => trim( $classnames ) ) );

	$content = '';
	while ( $query->have_posts() ) {
		$query->the_post();

		// Get an instance of the current Post Template block.
		$block_instance = $block->parsed_block;

		// Set the block name to one that does not correspond to an existing registered block.
		// This ensures that for the inner instances of the Post Template block, we do not render any block supports.
		$block_instance['blockName'] = 'core/null';

		$post_id              = get_the_ID();
		$post_type            = get_post_type();
		$filter_block_context = static function ( $context ) use ( $post_id, $post_type ) {
			$context['postType'] = $post_type;
			$context['postId']   = $post_id;
			return $context;
		};

		// Use an early priority to so that other 'render_block_context' filters have access to the values.
		add_filter( 'render_block_context', $filter_block_context, 1 );
		// Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling
		// `render_callback` and ensure that no wrapper markup is included.
		$block_content = ( new WP_Block( $block_instance ) )->render( array( 'dynamic' => false ) );
		remove_filter( 'render_block_context', $filter_block_context, 1 );

		// Wrap the render inner blocks in a `li` element with the appropriate post classes.
		$post_classes = implode( ' ', get_post_class( 'wp-block-post' ) );

		$inner_block_directives = $enhanced_pagination ? ' data-wp-key="post-template-item-' . $post_id . '"' : '';

		$content .= '<li' . $inner_block_directives . ' class="' . esc_attr( $post_classes ) . '">' . $block_content . '</li>';
	}

	/*
	 * Use this function to restore the context of the template tags
	 * from a secondary query loop back to the main query loop.
	 * Since we use two custom loops, it's safest to always restore.
	*/
	wp_reset_postdata();

	return sprintf(
		'<ul %1$s>%2$s</ul>',
		$wrapper_attributes,
		$content
	);
}

/**
 * Registers the `core/post-template` block on the server.
 */
function register_block_core_post_template() {
	register_block_type_from_metadata(
		__DIR__ . '/post-template',
		array(
			'render_callback'   => 'render_block_core_post_template',
			'skip_inner_blocks' => true,
		)
	);
}
add_action( 'init', 'register_block_core_post_template' );

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
archives
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
audio
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
avatar
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
block
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
button
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
buttons
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
calendar
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
categories
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
code
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
column
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
columns
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comment-author-name
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comment-content
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comment-date
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comment-edit-link
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comment-reply-link
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comment-template
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comments
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comments-pagination
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comments-pagination-next
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comments-pagination-numbers
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comments-pagination-previous
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
comments-title
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
cover
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
details
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
embed
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
file
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
footnotes
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
freeform
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
gallery
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
group
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
heading
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
home-link
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
html
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
image
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
latest-comments
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
latest-posts
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
legacy-widget
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
list
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
list-item
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
loginout
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
media-text
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
missing
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
more
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
navigation
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
navigation-link
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
navigation-submenu
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
nextpage
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
page-list
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
page-list-item
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
paragraph
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
pattern
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-author
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-author-biography
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-author-name
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-comments-form
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-content
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-date
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-excerpt
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-featured-image
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-navigation-link
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-template
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-terms
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
post-title
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
preformatted
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
pullquote
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
query
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
query-no-results
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
query-pagination
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
query-pagination-next
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
query-pagination-numbers
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
query-pagination-previous
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
query-title
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
quote
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
read-more
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
rss
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
search
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
separator
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
shortcode
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
site-logo
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
site-tagline
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
site-title
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
social-link
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
social-links
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
spacer
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
table
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
tag-cloud
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
template-part
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
term-description
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
text-columns
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
verse
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
video
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
widget-group
--
2 Mar 2024 8.56 AM
u550391411 / o200927086
0755
archives.php
2.887 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
avatar.php
5.511 KB
10 Apr 2024 5.51 PM
u550391411 / o200927086
0644
block.php
1.566 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
blocks-json.php
159.815 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
calendar.php
5.986 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
categories.php
2.781 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comment-author-name.php
2.046 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comment-content.php
2.364 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comment-date.php
1.559 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comment-edit-link.php
1.636 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comment-reply-link.php
1.989 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comment-template.php
4.352 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comments-pagination-next.php
1.811 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comments-pagination-numbers.php
1.557 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comments-pagination-previous.php
1.607 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comments-pagination.php
1.134 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comments-title.php
2.67 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
comments.php
6.469 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
cover.php
2.452 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
file.php
3.261 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
footnotes.php
3.031 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
gallery.php
4.836 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
heading.php
1.233 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
home-link.php
5.192 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
image.php
14.358 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
index.php
4.478 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
latest-comments.php
4.885 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
latest-posts.php
8.17 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
legacy-widget.php
3.811 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
loginout.php
1.348 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
navigation-link.php
11.649 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
navigation-submenu.php
8.814 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
navigation.php
37.307 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
page-list-item.php
0.334 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
page-list.php
13.137 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
pattern.php
1.404 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-author-biography.php
1.414 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-author-name.php
1.705 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-author.php
2.507 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-comments-form.php
2.684 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-content.php
2.068 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-date.php
2.289 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-excerpt.php
3.329 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-featured-image.php
7.374 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-navigation-link.php
4.378 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-template.php
5.521 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-terms.php
3.307 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
post-title.php
2.019 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
query-no-results.php
1.711 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
query-pagination-next.php
3.596 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
query-pagination-numbers.php
4.409 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
query-pagination-previous.php
3.052 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
query-pagination.php
1.111 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
query-title.php
2.012 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
query.php
7.163 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
read-more.php
1.75 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
require-dynamic-blocks.php
3.852 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
require-static-blocks.php
0.523 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
rss.php
3.834 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
search.php
23.936 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
shortcode.php
0.681 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
site-logo.php
5.794 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
site-tagline.php
0.971 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
site-title.php
1.729 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
social-link.php
60.442 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
tag-cloud.php
1.37 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
template-part.php
9.501 KB
25 Jun 2024 6.26 PM
u550391411 / o200927086
0644
term-description.php
1.268 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644
widget-group.php
2.115 KB
2 Mar 2024 8.56 AM
u550391411 / o200927086
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF