PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | modules/shortcodes/shortcode-utils.php +36 -0 16.2-beta → 16.3 View file →
@@ -1,0 +1,36 @@
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 +}