[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/blocks/ -> search.php (summary)

Server-side rendering of the `core/search` block.

File Size: 604 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 10 functions

  render_block_core_search()
  register_block_core_search()
  classnames_for_block_core_search()
  apply_block_core_search_border_style()
  apply_block_core_search_border_styles()
  styles_for_block_core_search()
  get_typography_classes_for_block_core_search()
  get_typography_styles_for_block_core_search()
  get_border_color_classes_for_block_core_search()
  get_color_classes_for_block_core_search()

Functions
Functions that are not part of a class:

render_block_core_search( $attributes )   X-Ref
Dynamically renders the `core/search` block.

return: string The search block markup.
param: array    $attributes The block attributes.
param: string   $content    The saved content.
param: WP_Block $block      The parsed block.

register_block_core_search()   X-Ref
Registers the `core/search` block on the server.


classnames_for_block_core_search( $attributes )   X-Ref
Builds the correct top level classnames for the 'core/search' block.

return: string The classnames used in the block.
param: array $attributes The block attributes.

apply_block_core_search_border_style( $attributes, $property, $side, &$wrapper_styles, &$button_styles, &$input_styles )   X-Ref
This generates a CSS rule for the given border property and side if provided.
Based on whether the Search block is configured to display the button inside
or not, the generated rule is injected into the appropriate collection of
styles for later application in the block's markup.

param: array  $attributes     The block attributes.
param: string $property       Border property to generate rule for e.g. width or color.
param: string $side           Optional side border. The dictates the value retrieved and final CSS property.
param: array  $wrapper_styles Current collection of wrapper styles.
param: array  $button_styles  Current collection of button styles.
param: array  $input_styles   Current collection of input styles.

apply_block_core_search_border_styles( $attributes, $property, &$wrapper_styles, &$button_styles, &$input_styles )   X-Ref
This adds CSS rules for a given border property e.g. width or color. It
injects rules into the provided wrapper, button and input style arrays for
uniform "flat" borders or those with individual sides configured.

param: array  $attributes     The block attributes.
param: string $property       Border property to generate rule for e.g. width or color.
param: array  $wrapper_styles Current collection of wrapper styles.
param: array  $button_styles  Current collection of button styles.
param: array  $input_styles   Current collection of input styles.

styles_for_block_core_search( $attributes )   X-Ref
Builds an array of inline styles for the search block.

The result will contain one entry for shared styles such as those for the
inner input or button and a second for the inner wrapper should the block
be positioning the button "inside".

return: array Style HTML attribute.
param: array $attributes The block attributes.

get_typography_classes_for_block_core_search( $attributes )   X-Ref
Returns typography classnames depending on whether there are named font sizes/families.

return: string The typography color classnames to be applied to the block elements.
param: array $attributes The block attributes.

get_typography_styles_for_block_core_search( $attributes )   X-Ref
Returns typography styles to be included in an HTML style tag.
This excludes text-decoration, which is applied only to the label and button elements of the search block.

return: string A string of typography CSS declarations.
param: array $attributes The block attributes.

get_border_color_classes_for_block_core_search( $attributes )   X-Ref
Returns border color classnames depending on whether there are named or custom border colors.

return: string The border color classnames to be applied to the block elements.
param: array $attributes The block attributes.

get_color_classes_for_block_core_search( $attributes )   X-Ref
Returns color classnames depending on whether there are named or custom text and background colors.

return: string The color classnames to be applied to the block elements.
param: array $attributes The block attributes.



Generated : Tue Dec 3 08:20:01 2024 Cross-referenced by PHPXref