learndash_convert_block_markers_to_shortcode_content

apply_filters( 'learndash_convert_block_markers_to_shortcode_content',  string $content,  array $pattern_atts_array,  string $shortcode_slug,  string $block_slug )

Filters the shortcode content after converting it from WordPress block content.


Description #


Parameters #

$content

(string) Shortcode content after conversion.

$pattern_atts_array

(array) An array of pattern attributes to use for conversion.

$shortcode_slug

(string) The slug of shortcode.

$block_slug

(string) The slug of gutenberg block.


Source #

File: includes/gutenberg/lib/class-learndash-gutenberg-block.php


Examples #

 <?php
/**
 * Example usage for learndash_convert_block_markers_to_shortcode_content filter.
 */
add_filter(
	'learndash_convert_block_markers_to_shortcode_content',
	function( $content, $pattern_atts_array, $shortcode_slug, $block_slug ) {
		// May add any custom logic using $content, $pattern_atts_array, $shortcode_slug, $block_slug.

		// Always return $content.
		return $content;
	},
	10,
	4
);