wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



filter_block_core_template_part_attributes › WordPress Function

Seit6.5.5
Veraltetn/v
filter_block_core_template_part_attributes ( $attribute_value, $attribute_name, $allowed_html )
Parameter: (3)
  • (string) $attribute_value The attribute value to filter.
    Erforderlich: Ja
  • (string) $attribute_name The attribute name.
    Erforderlich: Ja
  • (array[]|string) $allowed_html An array of allowed HTML elements and attributes, or a context name such as 'post'. See wp_kses_allowed_html() for the list of accepted context names.
    Erforderlich: Ja
Gibt zurück:
  • (string) The sanitized attribute value.
Definiert in:
Codex:

Sanitizes the value of the Template Part block's `tagName` attribute.



Quellcode

function filter_block_core_template_part_attributes( $attribute_value, $attribute_name, $allowed_html ) {
	if ( empty( $attribute_value ) || 'tagName' !== $attribute_name ) {
		return $attribute_value;
	}
	if ( ! is_array( $allowed_html ) ) {
		$allowed_html = wp_kses_allowed_html( $allowed_html );
	}
	return isset( $allowed_html[ $attribute_value ] ) ? $attribute_value : '';
}