wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
block_core_paragraph_add_class › WordPress Function
Od7.0.0
Przestarzałyn/a
› block_core_paragraph_add_class ( $block_content )
| Parametry: |
|
| Powrót: |
|
| Zdefiniowane na: |
|
| Codex: |
Append the `wp-block-paragraph` class before rendering the stored `core/paragraph` block contents.
For example, the following block content:Hello World
Would be transformed to:Hello World
Źródło
function block_core_paragraph_add_class( $block_content ) {
if ( ! $block_content ) {
return $block_content;
}
$processor = new WP_HTML_Tag_Processor( $block_content );
if ( $processor->next_tag( 'p' ) ) {
$processor->add_class( 'wp-block-paragraph' );
}
return $processor->get_updated_html();
}