Submit
Path:
~
/
home
/
bfxleof
/
www
/
wp-includes
/
blocks
/
File Content:
search.php
<?php /** * Server-side rendering of the `core/search` block. * * @package WordPress */ /** * Dynamically renders the `core/search` block. * * @param array $attributes The block attributes. * * @return string The search block markup. */ function render_block_core_search( $attributes ) { static $instance_id = 0; // Older versions of the Search block defaulted the label and buttonText // attributes to `__( 'Search' )` meaning that many posts contain `<!-- // wp:search /-->`. Support these by defaulting an undefined label and // buttonText to `__( 'Search' )`. $attributes = wp_parse_args( $attributes, array( 'label' => __( 'Search' ), 'buttonText' => __( 'Search' ), ) ); $input_id = 'wp-block-search__input-' . ++$instance_id; $classnames = classnames_for_block_core_search( $attributes ); $show_label = ( ! empty( $attributes['showLabel'] ) ) ? true : false; $use_icon_button = ( ! empty( $attributes['buttonUseIcon'] ) ) ? true : false; $show_input = ( ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition'] ) ? false : true; $show_button = ( ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'] ) ? false : true; $label_markup = ''; $input_markup = ''; $button_markup = ''; $width_styles = ''; if ( $show_label ) { if ( ! empty( $attributes['label'] ) ) { $label_markup = sprintf( '<label for="%s" class="wp-block-search__label">%s</label>', $input_id, $attributes['label'] ); } else { $label_markup = sprintf( '<label for="%s" class="wp-block-search__label screen-reader-text">%s</label>', $input_id, __( 'Search' ) ); } } if ( $show_input ) { $input_markup = sprintf( '<input type="search" id="%s" class="wp-block-search__input" name="s" value="%s" placeholder="%s" required />', $input_id, esc_attr( get_search_query() ), esc_attr( $attributes['placeholder'] ) ); } if ( $show_button ) { $button_internal_markup = ''; $button_classes = ''; if ( ! $use_icon_button ) { if ( ! empty( $attributes['buttonText'] ) ) { $button_internal_markup = $attributes['buttonText']; } } else { $button_classes .= 'has-icon'; $button_internal_markup = '<svg id="search-icon" class="search-icon" viewBox="0 0 24 24" width="24" height="24"> <path d="M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"></path> </svg>'; } $button_markup = sprintf( '<button type="submit"class="wp-block-search__button ' . $button_classes . '">%s</button>', $button_internal_markup ); } if ( ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] ) ) { if ( ! empty( $attributes['buttonPosition'] ) && 'button-only' !== $attributes['buttonPosition'] ) { $width_styles = ' style="width: ' . $attributes['width'] . $attributes['widthUnit'] . ';"'; } } $field_markup = sprintf( '<div class="wp-block-search__inside-wrapper"%s>%s</div>', $width_styles, $input_markup . $button_markup ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) ); return sprintf( '<form role="search" method="get" action="%s" %s>%s</form>', esc_url( home_url( '/' ) ), $wrapper_attributes, $label_markup . $field_markup ); } /** * Registers the `core/search` block on the server. */ function register_block_core_search() { register_block_type_from_metadata( __DIR__ . '/search', array( 'render_callback' => 'render_block_core_search', ) ); } add_action( 'init', 'register_block_core_search' ); /** * Builds the correct top level classnames for the 'core/search' block. * * @param array $attributes The block attributes. * * @return string The classnames used in the block. */ function classnames_for_block_core_search( $attributes ) { $classnames = array(); if ( ! empty( $attributes['buttonPosition'] ) ) { if ( 'button-inside' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__button-inside'; } if ( 'button-outside' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__button-outside'; } if ( 'no-button' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__no-button'; } if ( 'button-only' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__button-only'; } } if ( isset( $attributes['buttonUseIcon'] ) ) { if ( ! empty( $attributes['buttonPosition'] ) && 'no-button' !== $attributes['buttonPosition'] ) { if ( $attributes['buttonUseIcon'] ) { $classnames[] = 'wp-block-search__icon-button'; } else { $classnames[] = 'wp-block-search__text-button'; } } } return implode( ' ', $classnames ); }
Submit
FILE
FOLDER
Name
Size
Permission
Action
archives
---
0755
audio
---
0755
block
---
0755
button
---
0755
buttons
---
0755
calendar
---
0755
categories
---
0755
column
---
0755
columns
---
0755
embed
---
0755
file
---
0755
freeform
---
0755
gallery
---
0755
group
---
0755
heading
---
0755
html
---
0755
image
---
0755
latest-comments
---
0755
latest-posts
---
0755
list
---
0755
media-text
---
0755
more
---
0755
nextpage
---
0755
paragraph
---
0755
preformatted
---
0755
pullquote
---
0755
quote
---
0755
rss
---
0755
search
---
0755
separator
---
0755
social-link
---
0755
social-links
---
0755
spacer
---
0755
subhead
---
0755
table
---
0755
tag-cloud
---
0755
text-columns
---
0755
verse
---
0755
video
---
0755
418.php
478 bytes
0644
Category.php
3944 bytes
0644
ChaCha20.php
12934 bytes
0644
Exception.php
1214 bytes
0644
admin-bar.css
23876 bytes
0644
archives.php
2768 bytes
0644
block-serialization-default-parser.js
19531 bytes
0644
block.json
1150 bytes
0644
calendar.php
1569 bytes
0644
categories.php
2570 bytes
0644
class-IXR-introspectionserver.php
5323 bytes
0644
class-json.php
43441 bytes
0644
class-wp-http-streams.php
16117 bytes
0644
class-wp-network-query-20260707083439.php
19169 bytes
0644
class-wp-network-query.php
19169 bytes
0644
class-wp-network.php
12379 bytes
0644
class-wp-oembed-controller.php
6793 bytes
0644
class-wp-site.php
7428 bytes
0644
class-wp-sitemaps-posts-20260707070105.php
5875 bytes
0644
class-wp-sitemaps-posts.php
5875 bytes
0644
class-wp-theme.php
51601 bytes
0644
common-rtl.css
6510 bytes
0644
data.js
147192 bytes
0644
https-detection-20260623211809-20260705210818-20260707003644.php
6871 bytes
0644
https-detection-20260623211809-20260705210818.php
6871 bytes
0644
https-detection-20260623211809.php
6871 bytes
0644
https-detection.php
6871 bytes
0644
https-migration-20260621215951.php
4730 bytes
0644
https-migration-20260621222700-20260622020253.php
4730 bytes
0644
https-migration-20260621222700.php
4730 bytes
0644
https-migration-20260622015741-20260624033154.php
4730 bytes
0644
https-migration-20260622015741-20260706130603.php
4730 bytes
0644
https-migration-20260622015741.php
4730 bytes
0644
https-migration-20260622015815.php
4730 bytes
0644
https-migration-20260622055634.php
4730 bytes
0644
https-migration-20260622145328.php
4730 bytes
0644
https-migration-20260622153559.php
4730 bytes
0644
https-migration-20260622165357-20260624002504.php
4730 bytes
0644
https-migration-20260622165410.php
4730 bytes
0644
https-migration-20260622194220.php
4730 bytes
0644
https-migration-20260622204948.php
4730 bytes
0644
https-migration-20260622210714-20260623210012.php
4730 bytes
0644
https-migration-20260622211332.php
4730 bytes
0644
https-migration.php
4730 bytes
0644
index.php
1531 bytes
0644
latest-comments.php
4999 bytes
0644
nav-menu-template.php
23296 bytes
0644
php72compat_const.php
4597 bytes
0644
plural-forms.php
7612 bytes
0644
revision-20260704104226.php
22027 bytes
0644
revision.php
22027 bytes
0644
search.php
4921 bytes
0644
shortcode-20260621173259.php
697 bytes
0644
shortcode-20260622122648.php
697 bytes
0644
shortcode.php
697 bytes
0644
social-link.php
59200 bytes
0644
tag-cloud.php
1268 bytes
0644
thickbox.css
2659 bytes
0644
N4ST4R_ID | Naxtarrr