css
2 weeks ago
images
1 year ago
img
4 weeks ago
js
6 months ago
archiveorg-book.php
6 months ago
archiveorg.php
6 months ago
archives.php
2 weeks ago
bandcamp.php
6 months ago
brightcove.php
5 months ago
cartodb.php
6 months ago
class.filter-embedded-html-objects.php
6 months ago
codepen.php
6 months ago
crowdsignal.php
5 months ago
dailymotion.php
6 months ago
descript.php
6 months ago
facebook.php
6 months ago
flatio.php
6 months ago
flickr.php
5 months ago
getty.php
6 months ago
gist.php
6 months ago
googleapps.php
6 months ago
googlemaps.php
3 weeks ago
googleplus.php
6 months ago
gravatar.php
6 months ago
houzz.php
6 months ago
inline-pdfs.php
6 months ago
instagram.php
6 months ago
kickstarter.php
6 months ago
mailchimp.php
5 months ago
medium.php
6 months ago
mixcloud.php
6 months ago
others.php
6 months ago
pinterest.php
6 months ago
presentations.php
6 months ago
quiz.php
6 months ago
recipe.php
6 months ago
scribd.php
6 months ago
shortcode-utils.php
6 months ago
sitemap.php
6 months ago
slideshare.php
6 months ago
slideshow.php
4 weeks ago
smartframe.php
6 months ago
soundcloud.php
6 months ago
spotify.php
6 months ago
ted.php
6 months ago
tweet.php
6 months ago
twitchtv.php
6 months ago
twitter-timeline.php
6 months ago
twitter.php
6 months ago
unavailable.php
6 months ago
untappd-menu.php
6 months ago
upcoming-events.php
6 months ago
ustream.php
6 months ago
videopress.php
6 months ago
vimeo.php
1 week ago
vine.php
6 months ago
vr.php
1 week ago
wufoo.php
6 months ago
youtube.php
3 months ago
shortcode-utils.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Shared utility functions for Jetpack shortcodes. |
| 4 | * |
| 5 | * @package automattic/jetpack |
| 6 | */ |
| 7 | |
| 8 | use Automattic\Jetpack\Status\Request; |
| 9 | |
| 10 | if ( ! function_exists( 'jetpack_shortcodes_should_hook_pre_kses' ) ) { |
| 11 | /** |
| 12 | * Determine if shortcodes should hook on pre_kses. |
| 13 | * |
| 14 | * @param bool $force_recheck Whether to force a re-check of the request. Defaults to false. |
| 15 | * |
| 16 | * @return bool True if shortcodes should hook on pre_kses, false otherwise. |
| 17 | */ |
| 18 | function jetpack_shortcodes_should_hook_pre_kses( $force_recheck = false ) { |
| 19 | static $is_frontend; |
| 20 | |
| 21 | if ( $force_recheck || null === $is_frontend ) { |
| 22 | $is_frontend = Request::is_frontend( false ); |
| 23 | } |
| 24 | |
| 25 | $should_hook = ! $is_frontend; |
| 26 | |
| 27 | /** |
| 28 | * Filters whether shortcodes should hook on pre_kses. |
| 29 | * |
| 30 | * @since 15.0 |
| 31 | * |
| 32 | * @param bool $should_hook Whether shortcodes should hook on pre_kses. |
| 33 | */ |
| 34 | return apply_filters( 'jetpack_shortcodes_should_hook_pre_kses', $should_hook ); |
| 35 | } |
| 36 | } |
| 37 |