Remove markup.

This function will automatically remove the opening and the closing HTML tag. If the markup is self-closed, the HTML tag will be removed accordingly.

The “data-markup-id” is added as a HTML attribute if the development mode is enabled. This makes it very easy to find the content ID when inspecting an element in a web browser.

beans_remove_markup( string $id, bool $remove_actions = false )

Return: (bool) Will always return true.


$idstringtrue-The markup ID.
$remove_actionsboolfalsefalseWhether elements attached to a markup should be removed or not. This must be used with absolute caution.


function beans_remove_markup( $id, $remove_actions = false ) {

	if ( $remove_actions ) {
		return beans_add_filter( $id . '_markup', null );

	return beans_add_filter( $id . '_markup', false );