PATH:
home
/
bnathsfovv
/
symptomsofdepression.me
/
wp-includes
/
blocks
<?php /** * Server-side rendering of the `core/button` block. * * @package WordPress */ /** * Renders the `core/button` block on the server, * * @since 6.6.0 * * @param array $attributes The block attributes. * @param string $content The block content. * * @return string The block content. */ function render_block_core_button( $attributes, $content ) { $p = new WP_HTML_Tag_Processor( $content ); /* * The button block can render an `<a>` or `<button>` and also has a * `<div>` wrapper. Find the a or button tag. */ $tag = null; while ( $p->next_tag() ) { $tag = $p->get_tag(); if ( 'A' === $tag || 'BUTTON' === $tag ) { break; } } /* * If this happens, the likelihood is there's no block content, * or the block has been modified by a plugin. */ if ( null === $tag ) { return $content; } // If the next token is the closing tag, the button is empty. $is_empty = true; while ( $p->next_token() && $tag !== $p->get_token_name() && $is_empty ) { if ( '#comment' !== $p->get_token_type() ) { /** * Anything else implies this is not empty. * This might include any text content (including a space), * inline images or other HTML. */ $is_empty = false; } } /* * When there's no text, render nothing for the block. * See https://github.com/WordPress/gutenberg/issues/17221 for the * reasoning behind this. */ if ( $is_empty ) { return ''; } return $content; } /** * Registers the `core/button` block on server. * * @since 6.6.0 */ function register_block_core_button() { register_block_type_from_metadata( __DIR__ . '/button', array( 'render_callback' => 'render_block_core_button', ) ); } add_action( 'init', 'register_block_core_button' );
[+]
..
[+]
legacy-widget
[+]
spacer
[+]
html
[+]
query-total
[+]
audio
[+]
comments-title
[+]
accordion-panel
[+]
query-pagination-numbers
[+]
comment-template
[+]
list-item
[+]
comment-author-name
[+]
categories
[+]
post-comments-link
[+]
verse
[+]
term-name
[+]
accordion-heading
[+]
widget-group
[+]
template-part
[+]
comments-pagination-numbers
[+]
comment-content
[+]
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
[+]
media-text
[+]
separator
[+]
button
[+]
read-more
[+]
comments-pagination-next
[+]
table
[-] post-author-name.php
[edit]
[+]
term-count
[+]
latest-comments
[+]
missing
[-] comment-reply-link.php
[edit]
[+]
nextpage
[+]
post-comments-count
[+]
comments-pagination
[+]
image
[+]
embed
[+]
social-links
[+]
terms-query
[+]
block
[+]
heading
[+]
details
[+]
preformatted
[+]
loginout
[+]
post-title
[+]
comment-edit-link
[+]
post-author-name
[+]
post-date
[+]
comments-pagination-previous
[+]
footnotes
[+]
post-author
[+]
site-title
[+]
post-content
[+]
home-link
[+]
page-list-item
[+]
comments
[+]
query-no-results
[+]
latest-posts
[+]
navigation
[+]
shortcode
[+]
paragraph
[-] index.php
[edit]
[+]
quote
[+]
pattern
[+]
post-template
[+]
buttons
[+]
site-tagline
[+]
columns
[+]
navigation-overlay-close
[+]
math
[+]
navigation-submenu
[-] button.php
[edit]
[+]
navigation-link
[+]
post-navigation-link
[+]
post-author-biography
[+]
text-columns
[+]
calendar
[+]
gallery
[-] comments-pagination-next.php
[edit]
[+]
post-featured-image
[+]
avatar
[+]
term-template
[-] calendar.php
[edit]
[+]
search
[+]
list
[+]
term-description
[+]
query
[+]
accordion-item
[+]
site-logo
[-] avatar.php
[edit]
[+]
column
[+]
archives
[+]
accordion
[+]
social-link
[+]
file
[+]
query-pagination-next
[+]
comment-date
[+]
tag-cloud
[+]
icon
[+]
freeform
[+]
pullquote
[+]
query-title
[+]
video
[+]
cover