mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-27 14:53:08 +02:00
Shortcodes: Introduce apply_shortcodes()
as an alias for do_shortcode()
.
This better aligns with the semantics of applying filters to the input and returning a result, rather than performing an action and outputting to the current buffer. Props ljasinskipl, thefarlilacfield. Fixes #37422. Built from https://develop.svn.wordpress.org/trunk@47004 git-svn-id: http://core.svn.wordpress.org/trunk@46804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5e8fe89ef5
commit
9b3a895631
@ -159,6 +159,24 @@ function has_shortcode( $content, $tag ) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search content for shortcodes and filter shortcodes through their hooks.
|
||||||
|
*
|
||||||
|
* This function is an alias for do_shortcode().
|
||||||
|
*
|
||||||
|
* @since 5.4.0
|
||||||
|
*
|
||||||
|
* @see do_shortcode()
|
||||||
|
*
|
||||||
|
* @param string $content Content to search for shortcodes.
|
||||||
|
* @param bool $ignore_html When true, shortcodes inside HTML elements will be skipped.
|
||||||
|
* Default false.
|
||||||
|
* @return string Content with shortcodes filtered out.
|
||||||
|
*/
|
||||||
|
function apply_shortcodes( $content, $ignore_html = false ) {
|
||||||
|
return do_shortcode( $content, $ignore_html );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search content for shortcodes and filter shortcodes through their hooks.
|
* Search content for shortcodes and filter shortcodes through their hooks.
|
||||||
*
|
*
|
||||||
@ -170,8 +188,9 @@ function has_shortcode( $content, $tag ) {
|
|||||||
*
|
*
|
||||||
* @global array $shortcode_tags List of shortcode tags and their callback hooks.
|
* @global array $shortcode_tags List of shortcode tags and their callback hooks.
|
||||||
*
|
*
|
||||||
* @param string $content Content to search for shortcodes.
|
* @param string $content Content to search for shortcodes.
|
||||||
* @param bool $ignore_html When true, shortcodes inside HTML elements will be skipped.
|
* @param bool $ignore_html When true, shortcodes inside HTML elements will be skipped.
|
||||||
|
* Default false.
|
||||||
* @return string Content with shortcodes filtered out.
|
* @return string Content with shortcodes filtered out.
|
||||||
*/
|
*/
|
||||||
function do_shortcode( $content, $ignore_html = false ) {
|
function do_shortcode( $content, $ignore_html = false ) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-alpha-47003';
|
$wp_version = '5.4-alpha-47004';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user