PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 15.0.3
Jetpack – WP Security, Backup, Speed, & Growth v15.0.3
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 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 14.4.2 All 500 releases
jetpack / modules / shortcodes / shortcode-utils.php
shortcode-utils.php
37 lines 955 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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