PluginProbe
Advanced Ads – Ad Manager & AdSense / 2.0.9
Advanced Ads – Ad Manager & AdSense v2.0.9
2.0.26 2.0.25 2.0.24 2.0.23 2.0.22 2.0.21 1.38.0 1.39.0 1.39.1 1.39.2 1.39.3 1.39.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.40.0 1.40.1 1.40.2 All 348 releases
advanced-ads / includes / functions-core.php
functions-core.php
45 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Core functions
4 *
5 * @since 2.0.0
6 * @package AdvancedAds
7 * @author Advanced Ads <info@wpadvancedads.com>
8 */
9
10 use AdvancedAds\Framework\JSON;
11
12 /**
13 * Add to JSON object.
14 *
15 * @since 1.0.0
16 *
17 * @param mixed ...$args Arguments.
18 *
19 * Parameters can be
20 * 1. array|string Unique identifier or array<key, value>.
21 * 2. array|string The data itself can be either a scalar or an array.
22 * In Case of first param an array this can be object_name.
23 * 3. string Name for the JavaScript object.
24 * Passed directly, so it should be qualified JS variable.
25 *
26 * @return JSON
27 */
28 function wp_advads_json_add( ...$args ): JSON {
29 return wp_advads()->json->add( ...$args );
30 }
31
32 /**
33 * Remove from JSON object.
34 *
35 * @since 1.0.0
36 *
37 * @param string $key Unique identifier.
38 * @param string $object_name Name for the JavaScript object.
39 * Passed directly, so it should be qualified JS variable.
40 * @return JSON
41 */
42 function wp_advads_json_remove( $key, $object_name = false ): JSON {
43 return wp_advads()->json->remove( $key, $object_name );
44 }
45