wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_pre_kses_block_attributes › WordPress Function

Desde5.3.1
Obsoleton/a
wp_pre_kses_block_attributes ( $content, $allowed_html, $allowed_protocols )
Parâmetros: (3)
  • (string) $content Content to be run through KSES.
    Required: Yes
  • (array[]|string) $allowed_html An array of allowed HTML elements and attributes, or a context name such as 'post'.
    Required: Yes
  • (string[]) $allowed_protocols Array of allowed URL protocols.
    Required: Yes
Retorna:
  • (string) Filtered text to run through KSES.
Definido em:
Codex:

Removes non-allowable HTML from parsed block attribute values when filtering in the post context.



Fonte

function wp_pre_kses_block_attributes( $content, $allowed_html, $allowed_protocols ) {
	/*
	 * `filter_block_content` is expected to call `wp_kses`. Temporarily remove
	 * the filter to avoid recursion.
	 */
	remove_filter( 'pre_kses', 'wp_pre_kses_block_attributes', 10 );
	$content = filter_block_content( $content, $allowed_html, $allowed_protocols );
	add_filter( 'pre_kses', 'wp_pre_kses_block_attributes', 10, 3 );

	return $content;
}