Submit
Path:
F:
/
Inetpub
/
vhosts
/
solasmarine.com.tr
/
httpdocs
/
wp-includes
/
blocks
/
File Content:
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' );
Edit
Rename
Chmod
Delete
FILE
DIR
INFO
CMD
Name
Size
Permission
Action
accordion
---
0777
accordion-heading
---
0777
accordion-item
---
0777
accordion-panel
---
0777
archives
---
0777
audio
---
0777
avatar
---
0777
block
---
0777
breadcrumbs
---
0777
button
---
0777
buttons
---
0777
calendar
---
0777
categories
---
0777
code
---
0777
column
---
0777
columns
---
0777
comment-author-name
---
0777
comment-content
---
0777
comment-date
---
0777
comment-edit-link
---
0777
comment-reply-link
---
0777
comment-template
---
0777
comments
---
0777
comments-pagination
---
0777
comments-pagination-next
---
0777
comments-pagination-numbers
---
0777
comments-pagination-previous
---
0777
comments-title
---
0777
cover
---
0777
details
---
0777
embed
---
0777
file
---
0777
footnotes
---
0777
freeform
---
0777
gallery
---
0777
group
---
0777
heading
---
0777
home-link
---
0777
html
---
0777
icon
---
0777
image
---
0777
latest-comments
---
0777
latest-posts
---
0777
legacy-widget
---
0777
list
---
0777
list-item
---
0777
loginout
---
0777
math
---
0777
media-text
---
0777
missing
---
0777
more
---
0777
navigation
---
0777
navigation-link
---
0777
navigation-overlay-close
---
0777
navigation-submenu
---
0777
nextpage
---
0777
page-list
---
0777
page-list-item
---
0777
paragraph
---
0777
pattern
---
0777
post-author
---
0777
post-author-biography
---
0777
post-author-name
---
0777
post-comments-count
---
0777
post-comments-form
---
0777
post-comments-link
---
0777
post-content
---
0777
post-date
---
0777
post-excerpt
---
0777
post-featured-image
---
0777
post-navigation-link
---
0777
post-template
---
0777
post-terms
---
0777
post-time-to-read
---
0777
post-title
---
0777
preformatted
---
0777
pullquote
---
0777
query
---
0777
query-no-results
---
0777
query-pagination
---
0777
query-pagination-next
---
0777
query-pagination-numbers
---
0777
query-pagination-previous
---
0777
query-title
---
0777
query-total
---
0777
quote
---
0777
read-more
---
0777
rss
---
0777
search
---
0777
separator
---
0777
shortcode
---
0777
site-logo
---
0777
site-tagline
---
0777
site-title
---
0777
social-link
---
0777
social-links
---
0777
spacer
---
0777
table
---
0777
tag-cloud
---
0777
template-part
---
0777
term-count
---
0777
term-description
---
0777
term-name
---
0777
term-template
---
0777
terms-query
---
0777
text-columns
---
0777
verse
---
0777
video
---
0777
widget-group
---
0777
accordion-item.php
3041bytes
0666
accordion.php
1147bytes
0666
archives.php
4385bytes
0666
avatar.php
5634bytes
0666
block.php
4186bytes
0666
blocks-json.php
199123bytes
0666
breadcrumbs.php
19057bytes
0666
button.php
1752bytes
0666
calendar.php
6075bytes
0666
categories.php
4938bytes
0666
comment-author-name.php
2133bytes
0666
comment-content.php
2459bytes
0666
comment-date.php
1863bytes
0666
comment-edit-link.php
1713bytes
0666
comment-reply-link.php
2075bytes
0666
comment-template.php
4494bytes
0666
comments-pagination-next.php
1924bytes
0666
comments-pagination-numbers.php
1632bytes
0666
comments-pagination-previous.php
1790bytes
0666
comments-pagination.php
1261bytes
0666
comments-title.php
2787bytes
0666
comments.php
6784bytes
0666
cover.php
7422bytes
0666
details.php
1498bytes
0666
file.php
1879bytes
0666
footnotes.php
3818bytes
0666
gallery.php
9067bytes
0666
heading.php
1301bytes
0666
home-link.php
5438bytes
0666
icon.php
4139bytes
0666
image.php
17661bytes
0666
index.php
5111bytes
0666
latest-comments.php
5488bytes
0666
latest-posts.php
8843bytes
0666
legacy-widget.php
4011bytes
0666
list.php
1273bytes
0666
loginout.php
1664bytes
0666
media-text.php
4298bytes
0666
navigation-link.php
16221bytes
0666
navigation-overlay-close.php
1765bytes
0666
navigation-submenu.php
11744bytes
0666
navigation.php
64817bytes
0666
page-list-item.php
361bytes
0666
page-list.php
15069bytes
0666
paragraph.php
1139bytes
0666
pattern.php
1788bytes
0666
post-author-biography.php
1524bytes
0666
post-author-name.php
1951bytes
0666
post-author.php
2734bytes
0666
post-comments-count.php
1275bytes
0666
post-comments-form.php
2805bytes
0666
post-comments-link.php
2237bytes
0666
post-content.php
2347bytes
0666
post-date.php
3655bytes
0666
post-excerpt.php
4315bytes
0666
post-featured-image.php
9248bytes
0666
post-navigation-link.php
4807bytes
0666
post-template.php
5687bytes
0666
post-terms.php
3640bytes
0666
post-time-to-read.php
6411bytes
0666
post-title.php
2138bytes
0666
query-no-results.php
1847bytes
0666
query-pagination-next.php
3676bytes
0666
query-pagination-numbers.php
4700bytes
0666
query-pagination-previous.php
3473bytes
0666
query-pagination.php
1176bytes
0666
query-title.php
2771bytes
0666
query-total.php
2471bytes
0666
query.php
5690bytes
0666
read-more.php
1830bytes
0666
require-dynamic-blocks.php
4978bytes
0666
require-static-blocks.php
520bytes
0666
rss.php
4609bytes
0666
search.php
23817bytes
0666
shortcode.php
735bytes
0666
site-logo.php
6334bytes
0666
site-tagline.php
1203bytes
0666
site-title.php
1864bytes
0666
social-link.php
67602bytes
0666
tag-cloud.php
1590bytes
0666
template-part.php
10446bytes
0666
term-count.php
1843bytes
0666
term-description.php
1770bytes
0666
term-name.php
2038bytes
0666
term-template.php
4518bytes
0666
video.php
2733bytes
0666
widget-group.php
2438bytes
0666