GC_Embed::run_shortcode()

最后更新于:2021-11-27 14:41:20

GC_Embed::run_shortcode( string$content)

Process the shortcode.

参数

$content

(string) (Required) Content to parse

响应

(string) Content with shortcode parsed

源文件

文件: gc-includes/class-gc-embed.php

	public function run_shortcode( $content ) {
		global $shortcode_tags;

		// Back up current registered shortcodes and clear them all out.
		$orig_shortcode_tags = $shortcode_tags;
		remove_all_shortcodes();

		add_shortcode( 'embed', array( $this, 'shortcode' ) );

		// Do the shortcode (only the  one is registered).
		$content = do_shortcode( $content, true );

		// Put the original shortcodes back.
		$shortcode_tags = $orig_shortcode_tags;

		return $content;
	}