/
home
/
desid573
/
verdenaturopathy.com.au
/
site3
/
wp-includes
/
blocks
/
/home/desid573/verdenaturopathy.com.au/site3/wp-includes/blocks
mkdir
upload
Name
Size
Mode
Actions
accordion/
-
0755
rm
accordion-heading/
-
0755
rm
accordion-item/
-
0755
rm
accordion-panel/
-
0755
rm
archives/
-
0777
rm
audio/
-
0777
rm
avatar/
-
0777
rm
block/
-
0777
rm
breadcrumbs/
-
0755
rm
button/
-
0777
rm
buttons/
-
0777
rm
calendar/
-
0777
rm
categories/
-
0777
rm
code/
-
0777
rm
column/
-
0777
rm
columns/
-
0777
rm
comment-author-name/
-
0777
rm
comment-content/
-
0777
rm
comment-date/
-
0777
rm
comment-edit-link/
-
0777
rm
comment-reply-link/
-
0777
rm
comment-template/
-
0777
rm
comments/
-
0777
rm
comments-pagination/
-
0777
rm
comments-pagination-next/
-
0777
rm
comments-pagination-numbers/
-
0777
rm
comments-pagination-previous/
-
0777
rm
comments-title/
-
0777
rm
cover/
-
0777
rm
details/
-
0777
rm
embed/
-
0777
rm
file/
-
0777
rm
footnotes/
-
0777
rm
freeform/
-
0777
rm
gallery/
-
0777
rm
group/
-
0777
rm
heading/
-
0777
rm
home-link/
-
0777
rm
html/
-
0777
rm
icon/
-
0755
rm
image/
-
0777
rm
latest-comments/
-
0777
rm
latest-posts/
-
0777
rm
legacy-widget/
-
0777
rm
list/
-
0777
rm
list-item/
-
0777
rm
loginout/
-
0777
rm
math/
-
0755
rm
media-text/
-
0777
rm
missing/
-
0777
rm
more/
-
0777
rm
navigation/
-
0777
rm
navigation-link/
-
0777
rm
navigation-overlay-close/
-
0755
rm
navigation-submenu/
-
0777
rm
nextpage/
-
0777
rm
page-list/
-
0777
rm
page-list-item/
-
0777
rm
paragraph/
-
0777
rm
pattern/
-
0777
rm
post-author/
-
0777
rm
post-author-biography/
-
0777
rm
post-author-name/
-
0777
rm
post-comments-count/
-
0755
rm
post-comments-form/
-
0777
rm
post-comments-link/
-
0755
rm
post-content/
-
0777
rm
post-date/
-
0777
rm
post-excerpt/
-
0777
rm
post-featured-image/
-
0777
rm
post-navigation-link/
-
0777
rm
post-template/
-
0777
rm
post-terms/
-
0777
rm
post-time-to-read/
-
0755
rm
post-title/
-
0777
rm
preformatted/
-
0777
rm
pullquote/
-
0777
rm
query/
-
0777
rm
query-no-results/
-
0777
rm
query-pagination/
-
0777
rm
query-pagination-next/
-
0777
rm
query-pagination-numbers/
-
0777
rm
query-pagination-previous/
-
0777
rm
query-title/
-
0777
rm
query-total/
-
0777
rm
quote/
-
0777
rm
read-more/
-
0777
rm
rss/
-
0777
rm
search/
-
0777
rm
separator/
-
0777
rm
shortcode/
-
0777
rm
site-logo/
-
0777
rm
site-tagline/
-
0777
rm
site-title/
-
0777
rm
social-link/
-
0777
rm
social-links/
-
0777
rm
spacer/
-
0777
rm
table/
-
0777
rm
tag-cloud/
-
0777
rm
template-part/
-
0777
rm
term-count/
-
0755
rm
term-description/
-
0777
rm
term-name/
-
0755
rm
term-template/
-
0755
rm
terms-query/
-
0755
rm
text-columns/
-
0777
rm
verse/
-
0777
rm
video/
-
0777
rm
widget-group/
-
0777
rm
accordion-item.php
3041
0644
edit
dl
rm
accordion.php
1147
0644
edit
dl
rm
archives.php
4385
0644
edit
dl
rm
avatar.php
5634
0644
edit
dl
rm
block.php
4186
0644
edit
dl
rm
blocks-json.php
199238
0644
edit
dl
rm
breadcrumbs.php
19057
0644
edit
dl
rm
button.php
1752
0644
edit
dl
rm
calendar.php
6075
0644
edit
dl
rm
categories.php
4938
0644
edit
dl
rm
comment-author-name.php
2133
0644
edit
dl
rm
comment-content.php
2459
0644
edit
dl
rm
comment-date.php
1863
0644
edit
dl
rm
comment-edit-link.php
1713
0644
edit
dl
rm
comment-reply-link.php
2075
0644
edit
dl
rm
comment-template.php
4494
0644
edit
dl
rm
comments-pagination-next.php
1924
0644
edit
dl
rm
comments-pagination-numbers.php
1632
0644
edit
dl
rm
comments-pagination-previous.php
1790
0644
edit
dl
rm
comments-pagination.php
1261
0644
edit
dl
rm
comments-title.php
2787
0644
edit
dl
rm
comments.php
6784
0644
edit
dl
rm
cover.php
7422
0644
edit
dl
rm
details.php
1498
0644
edit
dl
rm
file.php
1879
0644
edit
dl
rm
footnotes.php
3818
0644
edit
dl
rm
gallery.php
9067
0644
edit
dl
rm
heading.php
1301
0644
edit
dl
rm
home-link.php
5438
0644
edit
dl
rm
icon.php
4139
0644
edit
dl
rm
image.php
17672
0644
edit
dl
rm
index.php
5111
0644
edit
dl
rm
latest-comments.php
5622
0644
edit
dl
rm
latest-posts.php
8843
0644
edit
dl
rm
legacy-widget.php
4011
0644
edit
dl
rm
list.php
1273
0644
edit
dl
rm
loginout.php
1664
0644
edit
dl
rm
media-text.php
4298
0644
edit
dl
rm
navigation-link.php
16405
0644
edit
dl
rm
navigation-overlay-close.php
1765
0644
edit
dl
rm
navigation-submenu.php
12584
0644
edit
dl
rm
navigation.php
64446
0644
edit
dl
rm
page-list-item.php
361
0644
edit
dl
rm
page-list.php
15096
0644
edit
dl
rm
paragraph.php
1139
0644
edit
dl
rm
pattern.php
1788
0644
edit
dl
rm
post-author-biography.php
1524
0644
edit
dl
rm
post-author-name.php
1951
0644
edit
dl
rm
post-author.php
2734
0644
edit
dl
rm
post-comments-count.php
1275
0644
edit
dl
rm
post-comments-form.php
2805
0644
edit
dl
rm
post-comments-link.php
2237
0644
edit
dl
rm
post-content.php
2668
0644
edit
dl
rm
post-date.php
3692
0644
edit
dl
rm
post-excerpt.php
4315
0644
edit
dl
rm
post-featured-image.php
9248
0644
edit
dl
rm
post-navigation-link.php
4807
0644
edit
dl
rm
post-template.php
5687
0644
edit
dl
rm
post-terms.php
3640
0644
edit
dl
rm
post-time-to-read.php
6411
0644
edit
dl
rm
post-title.php
2138
0644
edit
dl
rm
query-no-results.php
1847
0644
edit
dl
rm
query-pagination-next.php
3676
0644
edit
dl
rm
query-pagination-numbers.php
4700
0644
edit
dl
rm
query-pagination-previous.php
3473
0644
edit
dl
rm
query-pagination.php
1176
0644
edit
dl
rm
query-title.php
2771
0644
edit
dl
rm
query-total.php
2471
0644
edit
dl
rm
query.php
5690
0644
edit
dl
rm
read-more.php
1830
0644
edit
dl
rm
require-dynamic-blocks.php
4978
0644
edit
dl
rm
require-static-blocks.php
520
0644
edit
dl
rm
rss.php
4609
0644
edit
dl
rm
search.php
23817
0644
edit
dl
rm
shortcode.php
735
0644
edit
dl
rm
site-logo.php
6334
0644
edit
dl
rm
site-tagline.php
1203
0644
edit
dl
rm
site-title.php
1864
0644
edit
dl
rm
social-link.php
67602
0644
edit
dl
rm
tag-cloud.php
1590
0644
edit
dl
rm
template-part.php
10446
0644
edit
dl
rm
term-count.php
1843
0644
edit
dl
rm
term-description.php
1770
0644
edit
dl
rm
term-name.php
2038
0644
edit
dl
rm
term-template.php
4518
0644
edit
dl
rm
video.php
2733
0644
edit
dl
rm
widget-group.php
2438
0644
edit
dl
rm
Edit:
/home/desid573/verdenaturopathy.com.au/site3/wp-includes/blocks/comments.php
(6784B)
<?php /** * Server-side rendering of the `core/comments` block. * * @package WordPress */ /** * Renders the `core/comments` block on the server. * * This render callback is mainly for rendering a dynamic, legacy version of * this block (the old `core/post-comments`). It uses the `comments_template()` * function to generate the output, in the same way as classic PHP themes. * * As this callback will always run during SSR, first we need to check whether * the block is in legacy mode. If not, the HTML generated in the editor is * returned instead. * * @since 6.1.0 * * @global WP_Post $post Global post object. * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. * @return string Returns the filtered post comments for the current post wrapped inside "p" tags. */ function render_block_core_comments( $attributes, $content, $block ) { global $post; if ( ! isset( $block->context['postId'] ) ) { return ''; } $post_id = $block->context['postId']; // Return early if there are no comments and comments are closed. if ( ! comments_open( $post_id ) && (int) get_comments_number( $post_id ) === 0 ) { return ''; } // If this isn't the legacy block, we need to render the static version of this block. $is_legacy = 'core/post-comments' === $block->name || ! empty( $attributes['legacy'] ); if ( ! $is_legacy ) { return $block->render( array( 'dynamic' => false ) ); } $post_before = $post; $post = get_post( $post_id ); setup_postdata( $post ); ob_start(); /* * There's a deprecation warning generated by WP Core. * Ideally this deprecation is removed from Core. * In the meantime, this removes it from the output. */ add_filter( 'deprecated_file_trigger_error', '__return_false' ); comments_template(); remove_filter( 'deprecated_file_trigger_error', '__return_false' ); $output = ob_get_clean(); $post = $post_before; $classnames = array(); // Adds the old class name for styles' backwards compatibility. if ( isset( $attributes['legacy'] ) ) { $classnames[] = 'wp-block-post-comments'; } if ( isset( $attributes['textAlign'] ) ) { $classnames[] = 'has-text-align-' . $attributes['textAlign']; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); /* * Enqueues scripts and styles required only for the legacy version. That is * why they are not defined in `block.json`. */ wp_enqueue_script( 'comment-reply' ); enqueue_legacy_post_comments_block_styles( $block->name ); return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $output ); } /** * Registers the `core/comments` block on the server. * * @since 6.1.0 */ function register_block_core_comments() { register_block_type_from_metadata( __DIR__ . '/comments', array( 'render_callback' => 'render_block_core_comments', 'skip_inner_blocks' => true, ) ); } add_action( 'init', 'register_block_core_comments' ); /** * Use the button block classes for the form-submit button. * * @since 6.1.0 * * @param array $fields The default comment form arguments. * * @return array Returns the modified fields. */ function comments_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { $fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link ' . wp_theme_get_element_class_name( 'button' ) . '" value="%4$s" />'; $fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>'; } return $fields; } add_filter( 'comment_form_defaults', 'comments_block_form_defaults' ); /** * Enqueues styles from the legacy `core/post-comments` block. These styles are * required only by the block's fallback. * * @since 6.1.0 * * @param string $block_name Name of the new block type. */ function enqueue_legacy_post_comments_block_styles( $block_name ) { static $are_styles_enqueued = false; if ( ! $are_styles_enqueued ) { $handles = array( 'wp-block-post-comments', 'wp-block-buttons', 'wp-block-button', ); foreach ( $handles as $handle ) { wp_enqueue_block_style( $block_name, array( 'handle' => $handle ) ); } $are_styles_enqueued = true; } } /** * Ensures backwards compatibility for any users running the Gutenberg plugin * who have used Post Comments before it was merged into Comments Query Loop. * * The same approach was followed when core/query-loop was renamed to * core/post-template. * * @since 6.1.0 * * @see https://github.com/WordPress/gutenberg/pull/41807 * @see https://github.com/WordPress/gutenberg/pull/32514 */ function register_legacy_post_comments_block() { $registry = WP_Block_Type_Registry::get_instance(); /* * Remove the old `post-comments` block if it was already registered, as it * is about to be replaced by the type defined below. */ if ( $registry->is_registered( 'core/post-comments' ) ) { unregister_block_type( 'core/post-comments' ); } // Recreate the legacy block metadata. $metadata = array( 'name' => 'core/post-comments', 'category' => 'theme', 'attributes' => array( 'textAlign' => array( 'type' => 'string', ), ), 'uses_context' => array( 'postId', 'postType', ), 'supports' => array( 'html' => false, 'align' => array( 'wide', 'full' ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalDefaultControls' => array( 'fontSize' => true, ), ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, ), ), 'inserter' => false, ), 'style' => array( 'wp-block-post-comments', 'wp-block-buttons', 'wp-block-button', ), 'render_callback' => 'render_block_core_comments', 'skip_inner_blocks' => true, ); /* * Filters the metadata object, the same way it's done inside * `register_block_type_from_metadata()`. This applies some default filters, * like `_wp_multiple_block_styles`, which is required in this case because * the block has multiple styles. */ /** This filter is documented in wp-includes/blocks.php */ $metadata = apply_filters( 'block_type_metadata', $metadata ); register_block_type( 'core/post-comments', $metadata ); } add_action( 'init', 'register_legacy_post_comments_block', 21 );
Save
cmd:
run