Description
Expand the shortcodeReturns the cached version if available Note: The cached version may have been created for a different locale In tests we might need to reset it by calling bw_expand_shortcode with null
Usage
$string = bw_expand_shortcode( $example );Parameters
- $example
- ( string ) optional – shortcode to be expanded. Cannot be null in PHP 8.2
Returns
string the generated HTMLSource
File name: oik/libs/oik-sc-help.phpLines:
1 to 20 of 20
function bw_expand_shortcode( $example='' ) { static $previous_example = null; static $previous_expanded = null; static $previous_locale = null; $locale = get_locale(); if ( ( $previous_example == $example ) && ( $previous_locale == $locale ) ) { $expanded = $previous_expanded; } else { bw_save_scripts(); bw_push(); $expanded = apply_filters( 'the_content', $example ); bw_pop(); bw_save_scripts(); $previous_example = $example; $previous_expanded = $expanded; $previous_locale = $locale; } return $expanded; }View on GitHub View on Trac
Called by
1 to 3 of 3
- bw_invoke_shortcode() – Calls a shortcode for a simple example
- Tests_shortcodes_oik_thumbs::test_bw_thumbs__example() – Since it’s not easy to verify and all we want to do at present is to check the i18n/10n of the text preceding – We run the example twice – but throw away the output of the first call – Prior to running the second test we remove the shortcode.
- _sc__snippet() – Produce the HTML snippet of the shortcode output
Invoked by
Calls
1 to 3 of 3
