skip to Main Content

Add Custom Block to Post Content Builder Element

Important: Your custom callback function must be whitelisted or it will not work. This is for security reasons. Learn more →
/**
 * Register new block for the Post Content element.
 *
 * @link https://total.wpexplorer.com/docs/snippets/custom-block-post-content-module/
 */
add_filter( 'vcex_post_content_blocks', function( $blocks ) {
	$blocks['my_custom_block_callback'] = 'My Custom Block Name';
	return $blocks;
} );

/**
 * Callback function for the "my_custom_block_callback" Post Content element block.
 */
function my_custom_block_callback() {
	echo 'custom block output';
}
All PHP snippets should be added via child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)
Back To Top