golden hour
/home/phakp/public_html/wp-includes/blocks
⬆️ Go Up
Upload
File/Folder
Size
Actions
archives
-
Del
OK
archives.php
2.85 KB
Del
OK
audio
-
Del
OK
avatar
-
Del
OK
avatar.php
5.28 KB
Del
OK
block
-
Del
OK
block.php
1.63 KB
Del
OK
button
-
Del
OK
buttons
-
Del
OK
calendar
-
Del
OK
calendar.php
4.57 KB
Del
OK
categories
-
Del
OK
categories.php
2.72 KB
Del
OK
classic
-
Del
OK
code
-
Del
OK
column
-
Del
OK
columns
-
Del
OK
comment-author-name
-
Del
OK
comment-author-name.php
1.89 KB
Del
OK
comment-content
-
Del
OK
comment-content.php
2.23 KB
Del
OK
comment-date
-
Del
OK
comment-date.php
1.47 KB
Del
OK
comment-edit-link
-
Del
OK
comment-edit-link.php
1.5 KB
Del
OK
comment-reply-link
-
Del
OK
comment-reply-link.php
1.86 KB
Del
OK
comment-template
-
Del
OK
comment-template.php
3.26 KB
Del
OK
comments-pagination
-
Del
OK
comments-pagination-next
-
Del
OK
comments-pagination-next.php
1.8 KB
Del
OK
comments-pagination-numbers
-
Del
OK
comments-pagination-numbers.php
1.56 KB
Del
OK
comments-pagination-previous
-
Del
OK
comments-pagination-previous.php
1.6 KB
Del
OK
comments-pagination.php
967 B
Del
OK
comments-query-loop
-
Del
OK
comments-title
-
Del
OK
comments-title.php
2.67 KB
Del
OK
cover
-
Del
OK
cover.php
2.18 KB
Del
OK
embed
-
Del
OK
error_log
290 B
Del
OK
file
-
Del
OK
file.php
899 B
Del
OK
freeform
-
Del
OK
gallery
-
Del
OK
gallery.php
3.69 KB
Del
OK
group
-
Del
OK
heading
-
Del
OK
home-link
-
Del
OK
home-link.php
4.97 KB
Del
OK
html
-
Del
OK
image
-
Del
OK
image.php
1.27 KB
Del
OK
index.php
4.19 KB
Del
OK
latest-comments
-
Del
OK
latest-comments.php
4.88 KB
Del
OK
latest-posts
-
Del
OK
latest-posts.php
7.28 KB
Del
OK
legacy-widget
-
Del
OK
legacy-widget.php
3.81 KB
Del
OK
list
-
Del
OK
loginout
-
Del
OK
loginout.php
1.35 KB
Del
OK
media-text
-
Del
OK
missing
-
Del
OK
more
-
Del
OK
navigation
-
Del
OK
navigation-link
-
Del
OK
navigation-link.php
10.96 KB
Del
OK
navigation-submenu
-
Del
OK
navigation-submenu.php
9.53 KB
Del
OK
navigation.php
25.23 KB
Del
OK
nextpage
-
Del
OK
page-list
-
Del
OK
page-list.php
12.83 KB
Del
OK
paragraph
-
Del
OK
pattern
-
Del
OK
pattern.php
921 B
Del
OK
post-author
-
Del
OK
post-author-biography
-
Del
OK
post-author-biography.php
1.41 KB
Del
OK
post-author.php
2.05 KB
Del
OK
post-comments
-
Del
OK
post-comments-form
-
Del
OK
post-comments-form.php
2.5 KB
Del
OK
post-comments.php
2.43 KB
Del
OK
post-content
-
Del
OK
post-content.php
2.34 KB
Del
OK
post-date
-
Del
OK
post-date.php
1.51 KB
Del
OK
post-excerpt
-
Del
OK
post-excerpt.php
2.43 KB
Del
OK
post-featured-image
-
Del
OK
post-featured-image.php
2.14 KB
Del
OK
post-navigation-link
-
Del
OK
post-navigation-link.php
3.51 KB
Del
OK
post-template
-
Del
OK
post-template.php
3.94 KB
Del
OK
post-terms
-
Del
OK
post-terms.php
1.61 KB
Del
OK
post-title
-
Del
OK
post-title.php
1.62 KB
Del
OK
preformatted
-
Del
OK
pullquote
-
Del
OK
query
-
Del
OK
query-no-results
-
Del
OK
query-no-results.php
1.58 KB
Del
OK
query-pagination
-
Del
OK
query-pagination-next
-
Del
OK
query-pagination-next.php
2.66 KB
Del
OK
query-pagination-numbers
-
Del
OK
query-pagination-numbers.php
3.73 KB
Del
OK
query-pagination-previous
-
Del
OK
query-pagination-previous.php
2.12 KB
Del
OK
query-pagination.php
1023 B
Del
OK
query-title
-
Del
OK
query-title.php
1.35 KB
Del
OK
query.php
304 B
Del
OK
quote
-
Del
OK
read-more
-
Del
OK
read-more.php
1.31 KB
Del
OK
rss
-
Del
OK
rss.php
3.85 KB
Del
OK
search
-
Del
OK
search.php
12.74 KB
Del
OK
separator
-
Del
OK
shortcode
-
Del
OK
shortcode.php
697 B
Del
OK
site-logo
-
Del
OK
site-logo.php
5.67 KB
Del
OK
site-tagline
-
Del
OK
site-tagline.php
994 B
Del
OK
site-title
-
Del
OK
site-title.php
1.68 KB
Del
OK
social-link
-
Del
OK
social-link.php
57.56 KB
Del
OK
social-links
-
Del
OK
spacer
-
Del
OK
table
-
Del
OK
tag-cloud
-
Del
OK
tag-cloud.php
1.6 KB
Del
OK
template-part
-
Del
OK
template-part.php
7.24 KB
Del
OK
term-description
-
Del
OK
term-description.php
1.14 KB
Del
OK
text-columns
-
Del
OK
verse
-
Del
OK
video
-
Del
OK
widget-group
-
Del
OK
widget-group.php
2.12 KB
Del
OK
Edit: template-part.php
<?php /** * Server-side rendering of the `core/template-part` block. * * @package WordPress */ /** * Renders the `core/template-part` block on the server. * * @param array $attributes The block attributes. * * @return string The render. */ function render_block_core_template_part( $attributes ) { static $seen_ids = array(); $template_part_id = null; $content = null; $area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED; if ( isset( $attributes['slug'] ) && isset( $attributes['theme'] ) && wp_get_theme()->get_stylesheet() === $attributes['theme'] ) { $template_part_id = $attributes['theme'] . '//' . $attributes['slug']; $template_part_query = new WP_Query( array( 'post_type' => 'wp_template_part', 'post_status' => 'publish', 'post_name__in' => array( $attributes['slug'] ), 'tax_query' => array( array( 'taxonomy' => 'wp_theme', 'field' => 'slug', 'terms' => $attributes['theme'], ), ), 'posts_per_page' => 1, 'no_found_rows' => true, ) ); $template_part_post = $template_part_query->have_posts() ? $template_part_query->next_post() : null; if ( $template_part_post ) { // A published post might already exist if this template part was customized elsewhere // or if it's part of a customized template. $content = $template_part_post->post_content; $area_terms = get_the_terms( $template_part_post, 'wp_template_part_area' ); if ( ! is_wp_error( $area_terms ) && false !== $area_terms ) { $area = $area_terms[0]->name; } /** * Fires when a block template part is loaded from a template post stored in the database. * * @since 5.9.0 * * @param string $template_part_id The requested template part namespaced to the theme. * @param array $attributes The block attributes. * @param WP_Post $template_part_post The template part post object. * @param string $content The template part content. */ do_action( 'render_block_core_template_part_post', $template_part_id, $attributes, $template_part_post, $content ); } else { // Else, if the template part was provided by the active theme, // render the corresponding file content. $parent_theme_folders = get_block_theme_folders( get_template() ); $child_theme_folders = get_block_theme_folders( get_stylesheet() ); $child_theme_part_file_path = get_theme_file_path( '/' . $child_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' ); $parent_theme_part_file_path = get_theme_file_path( '/' . $parent_theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' ); $template_part_file_path = 0 === validate_file( $attributes['slug'] ) && file_exists( $child_theme_part_file_path ) ? $child_theme_part_file_path : $parent_theme_part_file_path; if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) { $content = file_get_contents( $template_part_file_path ); $content = is_string( $content ) && '' !== $content ? _inject_theme_attribute_in_block_template_content( $content ) : ''; } if ( '' !== $content && null !== $content ) { /** * Fires when a block template part is loaded from a template part in the theme. * * @since 5.9.0 * * @param string $template_part_id The requested template part namespaced to the theme. * @param array $attributes The block attributes. * @param string $template_part_file_path Absolute path to the template path. * @param string $content The template part content. */ do_action( 'render_block_core_template_part_file', $template_part_id, $attributes, $template_part_file_path, $content ); } else { /** * Fires when a requested block template part does not exist in the database nor in the theme. * * @since 5.9.0 * * @param string $template_part_id The requested template part namespaced to the theme. * @param array $attributes The block attributes. * @param string $template_part_file_path Absolute path to the not found template path. */ do_action( 'render_block_core_template_part_none', $template_part_id, $attributes, $template_part_file_path ); } } } // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent // is set in `wp_debug_mode()`. $is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY; if ( is_null( $content ) && $is_debug ) { if ( ! isset( $attributes['slug'] ) ) { // If there is no slug this is a placeholder and we dont want to return any message. return; } return sprintf( /* translators: %s: Template part slug. */ __( 'Template part has been deleted or is unavailable: %s' ), $attributes['slug'] ); } if ( isset( $seen_ids[ $template_part_id ] ) ) { return $is_debug ? // translators: Visible only in the front end, this warning takes the place of a faulty block. __( '[block rendering halted]' ) : ''; } // Run through the actions that are typically taken on the_content. $content = shortcode_unautop( $content ); $content = do_shortcode( $content ); $seen_ids[ $template_part_id ] = true; $content = do_blocks( $content ); unset( $seen_ids[ $template_part_id ] ); $content = wptexturize( $content ); $content = convert_smilies( $content ); $content = wp_filter_content_tags( $content ); // Handle embeds for block template parts. global $wp_embed; $content = $wp_embed->autoembed( $content ); if ( empty( $attributes['tagName'] ) || tag_escape( $attributes['tagName'] ) !== $attributes['tagName'] ) { $defined_areas = get_allowed_block_template_part_areas(); $area_tag = 'div'; foreach ( $defined_areas as $defined_area ) { if ( $defined_area['area'] === $area && isset( $defined_area['area_tag'] ) ) { $area_tag = $defined_area['area_tag']; } } $html_tag = $area_tag; } else { $html_tag = esc_attr( $attributes['tagName'] ); } $wrapper_attributes = get_block_wrapper_attributes(); return "<$html_tag $wrapper_attributes>" . str_replace( ']]>', ']]>', $content ) . "</$html_tag>"; } /** * Returns an array of variation objects for the template part block. * * @return array Array containing the block variation objects. */ function build_template_part_block_variations() { $variations = array(); $defined_areas = get_allowed_block_template_part_areas(); foreach ( $defined_areas as $area ) { if ( 'uncategorized' !== $area['area'] ) { $variations[] = array( 'name' => $area['area'], 'title' => $area['label'], 'description' => $area['description'], 'attributes' => array( 'area' => $area['area'], ), 'scope' => array( 'inserter' ), 'icon' => $area['icon'], ); } } return $variations; } /** * Registers the `core/template-part` block on the server. */ function register_block_core_template_part() { register_block_type_from_metadata( __DIR__ . '/template-part', array( 'render_callback' => 'render_block_core_template_part', 'variations' => build_template_part_block_variations(), ) ); } add_action( 'init', 'register_block_core_template_part' );
Save