PATH:
home
/
thecwrif
/
public_html
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/accordion-item` block. * * @package WordPress * @since 6.9.0 * * @param array $attributes The block attributes. * @param string $content The block content. * * @return string Returns the updated markup. */ function block_core_accordion_item_render( $attributes, $content ) { if ( ! $content ) { return $content; } $p = new WP_HTML_Tag_Processor( $content ); $unique_id = wp_unique_id( 'accordion-item-' ); // Initialize the state of the item on the server using a closure, // since we need to get derived state based on the current context. wp_interactivity_state( 'core/accordion', array( 'isOpen' => function () { $context = wp_interactivity_get_context(); return $context['openByDefault']; }, ) ); if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-item' ) ) ) { $open_by_default = $attributes['openByDefault'] ? 'true' : 'false'; $p->set_attribute( 'data-wp-context', '{ "id": "' . $unique_id . '", "openByDefault": ' . $open_by_default . ' }' ); $p->set_attribute( 'data-wp-class--is-open', 'state.isOpen' ); $p->set_attribute( 'data-wp-init', 'callbacks.initAccordionItems' ); $p->set_attribute( 'data-wp-on-window--hashchange', 'callbacks.hashChange' ); if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-heading__toggle' ) ) ) { $p->set_attribute( 'data-wp-on--click', 'actions.toggle' ); $p->set_attribute( 'data-wp-on--keydown', 'actions.handleKeyDown' ); $p->set_attribute( 'id', $unique_id ); $p->set_attribute( 'aria-controls', $unique_id . '-panel' ); $p->set_attribute( 'data-wp-bind--aria-expanded', 'state.isOpen' ); if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-panel' ) ) ) { $p->set_attribute( 'id', $unique_id . '-panel' ); $p->set_attribute( 'aria-labelledby', $unique_id ); $p->set_attribute( 'data-wp-bind--inert', '!state.isOpen' ); // Only modify content if all directives have been set. $content = $p->get_updated_html(); } } } return $content; } /** * Registers the `core/accordion-item` block on server. * * @since 6.9.0 */ function register_block_core_accordion_item() { register_block_type_from_metadata( __DIR__ . '/accordion-item', array( 'render_callback' => 'block_core_accordion_item_render', ) ); } add_action( 'init', 'register_block_core_accordion_item' );
[+]
..
[+]
terms-query
[+]
comment-edit-link
[+]
list
[-] query-total.php
[edit]
[-] media-text.php
[edit]
[+]
site-tagline
[+]
audio
[-] blocks-json.php
[edit]
[+]
navigation-submenu
[+]
post-date
[+]
comments-pagination-next
[-] comments-pagination-next.php
[edit]
[+]
post-author-biography
[-] navigation-submenu.php
[edit]
[+]
navigation
[+]
home-link
[+]
query-pagination-numbers
[-] tag-cloud.php
[edit]
[-] shortcode.php
[edit]
[-] list.php
[edit]
[-] term-description.php
[edit]
[-] page-list-item.php
[edit]
[+]
social-links
[-] post-comments-count.php
[edit]
[+]
post-comments-link
[+]
file
[-] pattern.php
[edit]
[+]
latest-posts
[+]
post-navigation-link
[-] post-author-biography.php
[edit]
[-] footnotes.php
[edit]
[+]
post-template
[-] post-title.php
[edit]
[+]
preformatted
[-] query-pagination-next.php
[edit]
[+]
paragraph
[+]
page-list
[+]
post-comments-count
[+]
term-count
[-] post-terms.php
[edit]
[+]
navigation-link
[-] accordion.php
[edit]
[-] post-time-to-read.php
[edit]
[+]
query-pagination-next
[-] template-part.php
[edit]
[-] home-link.php
[edit]
[+]
categories
[+]
site-title
[+]
avatar
[+]
comment-content
[+]
shortcode
[-] site-title.php
[edit]
[+]
term-template
[+]
embed
[+]
verse
[+]
template-part
[-] loginout.php
[edit]
[-] rss.php
[edit]
[-] page-list.php
[edit]
[+]
accordion-panel
[+]
latest-comments
[-] heading.php
[edit]
[+]
more
[+]
quote
[+]
comments
[-] search.php
[edit]
[-] comment-date.php
[edit]
[-] error_log
[edit]
[-] latest-comments.php
[edit]
[+]
post-comments-form
[+]
text-columns
[-] require-dynamic-blocks.php
[edit]
[-] block.php
[edit]
[+]
read-more
[+]
nextpage
[+]
columns
[-] term-name.php
[edit]
[-] calendar.php
[edit]
[+]
group
[+]
query-title
[-] post-template.php
[edit]
[+]
separator
[+]
pullquote
[-] post-date.php
[edit]
[-] comment-author-name.php
[edit]
[-] query-no-results.php
[edit]
[-] site-logo.php
[edit]
[+]
post-author
[-] read-more.php
[edit]
[+]
video
[+]
comment-reply-link
[-] image.php
[edit]
[-] comment-edit-link.php
[edit]
[-] navigation.php
[edit]
[-] comments-pagination.php
[edit]
[+]
post-title
[+]
query-no-results
[+]
widget-group
[-] comment-template.php
[edit]
[+]
query-total
[+]
rss
[+]
social-link
[-] post-author-name.php
[edit]
[+]
column
[+]
buttons
[-] term-count.php
[edit]
[-] comments.php
[edit]
[+]
spacer
[+]
code
[-] index.php
[edit]
[+]
site-logo
[+]
image
[+]
table
[+]
query-pagination
[+]
footnotes
[-] button.php
[edit]
[+]
comments-title
[+]
pattern
[+]
cover
[+]
list-item
[+]
block
[+]
media-text
[-] comment-content.php
[edit]
[-] term-template.php
[edit]
[+]
post-author-name
[-] post-comments-link.php
[edit]
[-] file.php
[edit]
[-] social-link.php
[edit]
[+]
details
[+]
tag-cloud
[-] gallery.php
[edit]
[-] widget-group.php
[edit]
[-] comments-title.php
[edit]
[+]
heading
[-] query-pagination-numbers.php
[edit]
[+]
query
[+]
gallery
[-] post-navigation-link.php
[edit]
[-] post-excerpt.php
[edit]
[+]
legacy-widget
[+]
post-featured-image
[+]
button
[+]
html
[-] post-content.php
[edit]
[-] query.php
[edit]
[-] accordion-item.php
[edit]
[-] post-comments-form.php
[edit]
[+]
page-list-item
[-] query-title.php
[edit]
[-] cover.php
[edit]
[-] comment-reply-link.php
[edit]
[+]
archives
[-] archives.php
[edit]
[-] categories.php
[edit]
[+]
accordion-heading
[+]
post-excerpt
[+]
query-pagination-previous
[+]
freeform
[+]
search
[-] comments-pagination-numbers.php
[edit]
[-] latest-posts.php
[edit]
[-] navigation-link.php
[edit]
[+]
loginout
[+]
comments-pagination
[-] site-tagline.php
[edit]
[+]
comments-pagination-previous
[+]
math
[-] post-author.php
[edit]
[-] query-pagination.php
[edit]
[+]
post-content
[-] require-static-blocks.php
[edit]
[+]
accordion
[+]
post-time-to-read
[+]
calendar
[+]
comment-date
[+]
comments-pagination-numbers
[-] comments-pagination-previous.php
[edit]
[+]
term-name
[+]
term-description
[-] avatar.php
[edit]
[+]
comment-template
[+]
accordion-item
[-] legacy-widget.php
[edit]
[+]
post-terms
[-] query-pagination-previous.php
[edit]
[-] post-featured-image.php
[edit]
[-] video.php
[edit]
[+]
missing
[+]
comment-author-name