PATH:
home
/
bnathsfovv
/
countdownnet.info
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/term-count` block. * * @package WordPress */ /** * Renders the `core/term-count` block on the server. * * @since 6.9.0 * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. * * @return string Returns the count of the current taxonomy term wrapped inside a heading tag. */ function render_block_core_term_count( $attributes, $content, $block ) { // Get term from context or from the current query. if ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) { $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); } else { $term = get_queried_object(); if ( ! $term instanceof WP_Term ) { $term = null; } } if ( ! $term || is_wp_error( $term ) ) { return ''; } $term_count = $term->count; // Format the term count based on bracket type. switch ( $attributes['bracketType'] ) { case 'none': // No formatting needed. break; case 'round': $term_count = "({$term_count})"; break; case 'square': $term_count = "[{$term_count}]"; break; case 'curly': $term_count = "{{$term_count}}"; break; case 'angle': $term_count = "<{$term_count}>"; break; default: // Default to no formatting for unknown types. break; } $wrapper_attributes = get_block_wrapper_attributes(); return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $term_count ); } /** * Registers the `core/term-count` block on the server. * * @since 6.9.0 */ function register_block_core_term_count() { register_block_type_from_metadata( __DIR__ . '/term-count', array( 'render_callback' => 'render_block_core_term_count', ) ); } add_action( 'init', 'register_block_core_term_count' );
[+]
..
[+]
legacy-widget
[-] file.php
[edit]
[-] details.php
[edit]
[+]
spacer
[+]
html
[+]
query-total
[+]
audio
[+]
comments-title
[-] site-title.php
[edit]
[-] loginout.php
[edit]
[+]
accordion-panel
[-] latest-posts.php
[edit]
[+]
query-pagination-numbers
[+]
comment-template
[+]
list-item
[+]
comment-author-name
[-] site-logo.php
[edit]
[+]
categories
[+]
post-comments-link
[-] post-content.php
[edit]
[-] shortcode.php
[edit]
[+]
verse
[+]
term-name
[+]
accordion-heading
[+]
widget-group
[+]
template-part
[+]
comments-pagination-numbers
[+]
comment-content
[-] icon.php
[edit]
[-] query-pagination-previous.php
[edit]
[+]
query-pagination-previous
[+]
comment-reply-link
[-] site-tagline.php
[edit]
[+]
query-pagination
[+]
code
[+]
breadcrumbs
[+]
post-comments-form
[-] media-text.php
[edit]
[+]
group
[+]
page-list
[-] tag-cloud.php
[edit]
[+]
post-excerpt
[+]
post-time-to-read
[+]
more
[+]
rss
[-] comment-edit-link.php
[edit]
[+]
media-text
[+]
separator
[-] block.php
[edit]
[-] post-excerpt.php
[edit]
[-] post-featured-image.php
[edit]
[+]
button
[+]
read-more
[-] post-comments-count.php
[edit]
[+]
comments-pagination-next
[+]
table
[-] video.php
[edit]
[-] post-author-name.php
[edit]
[-] template-part.php
[edit]
[-] navigation-link.php
[edit]
[+]
term-count
[+]
latest-comments
[+]
missing
[+]
nextpage
[-] heading.php
[edit]
[+]
post-comments-count
[+]
comments-pagination
[+]
image
[-] query-pagination-next.php
[edit]
[+]
embed
[+]
social-links
[-] categories.php
[edit]
[+]
terms-query
[-] post-comments-link.php
[edit]
[+]
block
[+]
heading
[+]
details
[+]
preformatted
[+]
loginout
[+]
post-title
[+]
comment-edit-link
[+]
post-author-name
[+]
post-terms
[+]
post-date
[+]
comments-pagination-previous
[+]
footnotes
[+]
post-author
[+]
site-title
[+]
post-content
[+]
home-link
[-] post-time-to-read.php
[edit]
[+]
page-list-item
[+]
comments
[+]
query-no-results
[-] comments.php
[edit]
[-] term-name.php
[edit]
[+]
latest-posts
[+]
navigation
[-] comment-date.php
[edit]
[+]
shortcode
[+]
paragraph
[-] index.php
[edit]
[+]
quote
[-] post-author-biography.php
[edit]
[-] latest-comments.php
[edit]
[-] post-template.php
[edit]
[+]
pattern
[+]
post-template
[+]
buttons
[+]
site-tagline
[+]
columns
[+]
navigation-overlay-close
[-] page-list-item.php
[edit]
[-] post-comments-form.php
[edit]
[+]
math
[+]
navigation-submenu
[-] comment-template.php
[edit]
[-] button.php
[edit]
[-] comments-pagination.php
[edit]
[+]
navigation-link
[-] term-count.php
[edit]
[+]
post-navigation-link
[+]
post-author-biography
[+]
text-columns
[-] comments-pagination-numbers.php
[edit]
[-] read-more.php
[edit]
[-] footnotes.php
[edit]
[+]
calendar
[+]
gallery
[-] comments-pagination-next.php
[edit]
[-] comments-pagination-previous.php
[edit]
[+]
post-featured-image
[+]
avatar
[+]
term-template
[-] comments-title.php
[edit]
[-] navigation-overlay-close.php
[edit]
[-] calendar.php
[edit]
[+]
search
[+]
list
[+]
term-description
[-] query-no-results.php
[edit]
[+]
query
[-] page-list.php
[edit]
[-] accordion-item.php
[edit]
[+]
accordion-item
[-] post-date.php
[edit]
[-] home-link.php
[edit]
[-] search.php
[edit]
[+]
site-logo
[-] paragraph.php
[edit]
[-] term-template.php
[edit]
[-] accordion.php
[edit]
[-] avatar.php
[edit]
[+]
column
[-] cover.php
[edit]
[-] social-link.php
[edit]
[+]
archives
[+]
accordion
[-] breadcrumbs.php
[edit]
[+]
social-link
[+]
file
[+]
query-pagination-next
[+]
comment-date
[-] post-navigation-link.php
[edit]
[+]
tag-cloud
[-] query-pagination-numbers.php
[edit]
[+]
icon
[+]
freeform
[+]
pullquote
[+]
query-title
[+]
video
[+]
cover