PluginProbe
Solace Extra / trunk
Solace Extra vtrunk
1.7.1 1.7.0 1.6.2 1.6.1 1.6.0 1.5.3 trunk 1.0.8 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.7 1.1.8 1.1.9 1.2.1 1.2.2 1.3.0 1.3.1 1.3.2 1.3.3 1.5.0 1.5.1 All 26 releases
solace-extra / admin / export-import / compat.php

compat.php in Solace Extra trunk, at admin/export-import/compat.php

43 lines 970 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5 /**
6 * Implementation for WordPress functions missing in older WordPress versions.
7 *
8 * @package WordPress
9 * @subpackage Importer
10 */
11
12 if ( ! function_exists( 'solace_extra_wp_slash_strings_only' ) ) {
13 /**
14 * Adds slashes to only string values in an array of values.
15 *
16 * Compat for WordPress < 5.3.0.
17 *
18 * @since 0.7.0
19 *
20 * @param mixed $value Scalar or array of scalars.
21 * @return mixed Slashes $value
22 */
23 function solace_extra_wp_slash_strings_only( $value ) {
24 return map_deep( $value, 'solace_extra_addslashes_strings_only' );
25 }
26 }
27
28 if ( ! function_exists( 'solace_extra_addslashes_strings_only' ) ) {
29 /**
30 * Adds slashes only if the provided value is a string.
31 *
32 * Compat for WordPress < 5.3.0.
33 *
34 * @since 0.7.0
35 *
36 * @param mixed $value
37 * @return mixed
38 */
39 function solace_extra_addslashes_strings_only( $value ) {
40 return is_string( $value ) ? addslashes( $value ) : $value;
41 }
42 }
43