printf( '
%s
', 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 ); } /** * 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". * * @param array $attributes The block attributes. * * @return array Style HTML attribute. */ function styles_for_block_core_search( $attributes ) { $wrapper_styles = array(); $button_styles = array(); $input_styles = array(); $is_button_inside = ! empty( $attributes['buttonPosition'] ) && 'button-inside' === $attributes['buttonPosition']; // Add width styles. $has_width = ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] ); $button_only = ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition']; if ( $has_width && ! $button_only ) { $wrapper_styles[] = sprintf( 'width: %d%s;', esc_attr( $attributes['width'] ), esc_attr( $attributes['widthUnit'] ) ); } // Add border width styles. $has_border_width = ! empty( $attributes['style']['border']['width'] ); if ( $has_border_width ) { $border_width = $attributes['style']['border']['width']; if ( $is_button_inside ) { $wrapper_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); } else { $button_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); $input_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); } } // Add border radius styles. $has_border_radius = ! empty( $attributes['style']['border']['radius'] ); if ( $has_border_radius ) { $default_padding = '4px'; $border_radius = $attributes['style']['border']['radius']; if ( is_array( $border_radius ) ) { // Apply styles for individual corner border radii. foreach ( $border_radius as $key => $value ) { if ( null !== $value ) { // Convert camelCase key to kebab-case. $name = strtolower( preg_replace( '/(? ! empty( $input_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $input_styles ) ) ) ) : '', 'button' => ! empty( $button_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $button_styles ) ) ) ) : '', 'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $wrapper_styles ) ) ) ) : '', ); } /** * Returns border color classnames depending on whether there are named or custom border colors. * * @param array $attributes The block attributes. * * @return string The border color classnames to be applied to the block elements. */ function get_border_color_classes_for_block_core_search( $attributes ) { $has_custom_border_color = ! empty( $attributes['style']['border']['color'] ); $border_color_classes = ! empty( $attributes['borderColor'] ) ? sprintf( 'has-border-color has-%s-border-color', $attributes['borderColor'] ) : ''; // If there's a border color style and no `borderColor` text string, we still want to add the generic `has-border-color` class name to the element. if ( $has_custom_border_color && empty( $attributes['borderColor'] ) ) { $border_color_classes = 'has-border-color'; } return $border_color_classes; } /** * Returns color classnames depending on whether there are named or custom text and background colors. * * @param array $attributes The block attributes. * * @return string The color classnames to be applied to the block elements. */ function get_color_classes_for_block_core_search( $attributes ) { $classnames = array(); // Text color. $has_named_text_color = ! empty( $attributes['textColor'] ); $has_custom_text_color = ! empty( $attributes['style']['color']['text'] ); if ( $has_named_text_color ) { $classnames[] = sprintf( 'has-text-color has-%s-color', $attributes['textColor'] ); } elseif ( $has_custom_text_color ) { // If a custom 'textColor' was selected instead of a preset, still add the generic `has-text-color` class. $classnames[] = 'has-text-color'; } // Background color. $has_named_background_color = ! empty( $attributes['backgroundColor'] ); $has_custom_background_color = ! empty( $attributes['style']['color']['background'] ); $has_named_gradient = ! empty( $attributes['gradient'] ); $has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] ); if ( $has_named_background_color || $has_custom_background_color || $has_named_gradient || $has_custom_gradient ) { $classnames[] = 'has-background'; } if ( $has_named_background_color ) { $classnames[] = sprintf( 'has-%s-background-color', $attributes['backgroundColor'] ); } if ( $has_named_gradient ) { $classnames[] = sprintf( 'has-%s-gradient-background', $attributes['gradient'] ); } return implode( ' ', $classnames ); } Página não encontrada – Planilhando

4cup-tea4

Opa! Página não encontrada..!

A página que você está procurando não existe.