Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/wp-includes/block-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,21 @@ function get_the_block_template_html() {
$content = wp_filter_content_tags( $content, 'template' );
$content = str_replace( ']]>', ']]>', $content );

/**
* Filters the wrapper element used in the site blocks.
*
* This filter allows the modification of the wrapper element that encloses the site blocks.
*
* @since 6.7.0
*
* @param string $element The HTML element to be used as the wrapper. Default 'div'.
* @param string $content The content to be wrapped.
*/
$wrapper_element = apply_filters( 'wp_site_blocks_wrapper_element', 'div', $content );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mukeshpanchal27 Thanks for reviewing this, I have implemented the suggestions please check.


// Wrap block template in .wp-site-blocks to allow for specific descendant styles
// (e.g. `.wp-site-blocks > *`).
return '<div class="wp-site-blocks">' . $content . '</div>';
return "<{$wrapper_element} class=\"wp-site-blocks\">{$content}</{$wrapper_element}>";
}

/**
Expand Down