PATH:
home
/
lab2454c
/
fcxpro.com
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/comment-reply-link` block. * * @package WordPress */ /** * Renders the `core/comment-reply-link` block on the server. * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. * @return string Return the post comment's reply link. */ function render_block_core_comment_reply_link( $attributes, $content, $block ) { if ( ! isset( $block->context['commentId'] ) ) { return ''; } $thread_comments = get_option( 'thread_comments' ); if ( ! $thread_comments ) { return ''; } $comment = get_comment( $block->context['commentId'] ); if ( empty( $comment ) ) { return ''; } $depth = 1; $max_depth = get_option( 'thread_comments_depth' ); $parent_id = $comment->comment_parent; // Compute comment's depth iterating over its ancestors. while ( ! empty( $parent_id ) ) { $depth++; $parent_id = get_comment( $parent_id )->comment_parent; } $comment_reply_link = get_comment_reply_link( array( 'depth' => $depth, 'max_depth' => $max_depth, ), $comment ); // Render nothing if the generated reply link is empty. if ( empty( $comment_reply_link ) ) { return; } $classes = ''; if ( isset( $attributes['textAlign'] ) ) { $classes .= 'has-text-align-' . $attributes['textAlign']; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $comment_reply_link ); } /** * Registers the `core/comment-reply-link` block on the server. */ function register_block_core_comment_reply_link() { register_block_type_from_metadata( __DIR__ . '/comment-reply-link', array( 'render_callback' => 'render_block_core_comment_reply_link', ) ); } add_action( 'init', 'register_block_core_comment_reply_link' );
[-] avatar.php
[edit]
[+]
post-content
[+]
post-comments
[+]
search
[+]
image
[+]
column
[-] comment-date.php
[edit]
[-] dropdown.php
[edit]
[+]
latest-comments
[-] post-navigation-link.php
[edit]
[+]
term-description
[+]
quote
[+]
audio
[+]
comment-template
[+]
social-links
[-] site-title.php
[edit]
[-] search.php
[edit]
[+]
comment-edit-link
[+]
comment-date
[+]
shortcode
[-] block.php
[edit]
[-] term-description.php
[edit]
[-] index.php
[edit]
[+]
navigation-submenu
[+]
widget-group
[+]
..
[+]
comments-pagination-next
[-] pattern.php
[edit]
[-] post-title.php
[edit]
[+]
heading
[-] post-excerpt.php
[edit]
[-] widget-group.php
[edit]
[+]
query-title
[+]
button
[+]
separator
[+]
spacer
[-] query-pagination-next.php
[edit]
[-] post-featured-image.php
[edit]
[+]
embed
[+]
query-pagination-next
[+]
comments-query-loop
[+]
text-columns
[+]
tag-cloud
[+]
more
[+]
comment-reply-link
[+]
site-title
[+]
site-tagline
[-] query-pagination-previous.php
[edit]
[-] tag-cloud.php
[edit]
[-] social-link.php
[edit]
[+]
cover
[-] rss.php
[edit]
[-] template-part.php
[edit]
[-] categories.php
[edit]
[+]
nextpage
[-] comment-template.php
[edit]
[-] post-date.php
[edit]
[-] cover.php
[edit]
[+]
comment-author-name
[+]
code
[+]
columns
[-] comments-pagination-next.php
[edit]
[+]
categories
[-] comment-content.php
[edit]
[+]
loginout
[-] calendar.php
[edit]
[+]
media-text
[+]
preformatted
[-] post-comments-form.php
[edit]
[-] post-comments.php
[edit]
[+]
legacy-widget
[-] latest-comments.php
[edit]
[-] navigation.php
[edit]
[+]
rss
[+]
archives
[+]
group
[-] navigation-link.php
[edit]
[+]
navigation-link
[+]
template-part
[+]
post-navigation-link
[-] site-logo.php
[edit]
[-] shortcode.php
[edit]
[-] comments-pagination-numbers.php
[edit]
[+]
post-title
[-] file.php
[edit]
[-] query.php
[edit]
[+]
post-excerpt
[+]
post-comments-form
[+]
block
[+]
post-template
[+]
comment-content
[+]
query
[+]
pattern
[+]
avatar
[+]
latest-posts
[+]
query-no-results
[+]
comments-pagination-numbers
[-] query-pagination-numbers.php
[edit]
[-] read-more.php
[edit]
[-] post-terms.php
[edit]
[+]
table
[-] page-list.php
[edit]
[+]
comments-pagination-previous
[-] site-tagline.php
[edit]
[-] query-no-results.php
[edit]
[-] comments-pagination-previous.php
[edit]
[+]
read-more
[+]
video
[+]
paragraph
[-] latest-posts.php
[edit]
[-] comments-title.php
[edit]
[-] post-author-biography.php
[edit]
[+]
query-pagination-previous
[+]
post-date
[+]
verse
[+]
file
[+]
post-author-biography
[+]
social-link
[+]
query-pagination
[-] post-content.php
[edit]
[+]
home-link
[+]
buttons
[-] post-template.php
[edit]
[-] archives.php
[edit]
[+]
calendar
[-] post-author.php
[edit]
[+]
list
[+]
page-list
[+]
missing
[-] comments-pagination.php
[edit]
[+]
pullquote
[+]
post-featured-image
[+]
comments-title
[-] query-title.php
[edit]
[+]
post-author
[+]
comments-pagination
[-] query-pagination.php
[edit]
[+]
site-logo
[+]
navigation
[-] loginout.php
[edit]
[-] navigation-submenu.php
[edit]
[-] legacy-widget.php
[edit]
[-] comment-edit-link.php
[edit]
[-] comment-author-name.php
[edit]
[-] home-link.php
[edit]
[+]
post-terms
[+]
query-pagination-numbers
[-] comment-reply-link.php
[edit]
[+]
freeform
[+]
gallery
[-] image.php
[edit]
[-] gallery.php
[edit]
[+]
html