Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional wrapper checkbox #60

Open
paulkirspuu opened this issue Mar 13, 2019 · 2 comments
Open

Additional wrapper checkbox #60

paulkirspuu opened this issue Mar 13, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@paulkirspuu
Copy link

Could you make additional block markup wrapper voluntary, perhaps add a setting to "additional settings" section?

Talking about this, $allow_wrapper = apply_filters( $block['slug'] . '/' . $context . '_allow_wrapper', $result && 'frontend' === $context, $attributes );.

@martynbiz
Copy link

I'd like to see this too. In the meantime, I've doing this but it's not very tidy:

// Stript the outer div from a block as it's breaking Bootstrap grid 
function wporg_strip_outer_div( $block_content, $block ) {
	if (substr($block['blockName'], 0, 10) == 'lazyblock/') {
		return preg_replace( '/^<[^>]+>|<\/[^>]+>$/', '', $block_content );
	} else {
		return $block_content;
	}
}
add_filter( 'render_block', 'wporg_strip_outer_div', 10, 2 );

@nk-o
Copy link
Collaborator

nk-o commented Jun 10, 2020

@martynbiz why are you doing this? We have PHP filters - https://lazyblocks.com/documentation/php-filters/lzb-block_render-allow_wrapper/

@nk-o nk-o added the enhancement New feature or request label Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants