PluginProbe ʕ •ᴥ•ʔ
Slider Ultimate / trunk
Slider Ultimate vtrunk
trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9
ultimate-slider / includes / Helper.class.php
ultimate-slider / includes Last commit date
AboutUs.class.php 3 years ago BackwardsCompatibility.class.php 4 years ago Blocks.class.php 4 years ago CustomPostTypes.class.php 1 year ago Dashboard.class.php 3 years ago DeactivationSurvey.class.php 4 years ago Helper.class.php 4 years ago InstallationWalkthrough.class.php 4 years ago Permissions.class.php 4 years ago ReviewAsk.class.php 4 years ago Settings.class.php 1 year ago Widgets.class.php 4 years ago WooCommerceIntegration.class.php 4 years ago template-functions.php 1 year ago
Helper.class.php
94 lines
1 <?php
2 if ( !defined( 'ABSPATH' ) ) exit;
3
4 if ( !class_exists( 'ewdusHelper' ) ) {
5 /**
6 * Class to to provide helper functions
7 *
8 * @since 2.0.9
9 */
10 class ewdusHelper {
11
12 // Hold the class instance.
13 private static $instance = null;
14
15 /**
16 * The constructor is private
17 * to prevent initiation with outer code.
18 *
19 **/
20 private function __construct() {}
21
22 /**
23 * The object is created from within the class itself
24 * only if the class has no instance.
25 */
26 public static function getInstance() {
27
28 if ( self::$instance == null ) {
29
30 self::$instance = new ewdusHelper();
31 }
32
33 return self::$instance;
34 }
35
36 /**
37 * Handle ajax requests in admin area for logged out users
38 * @since 2.0.9
39 */
40 public static function admin_nopriv_ajax() {
41
42 wp_send_json_error(
43 array(
44 'error' => 'loggedout',
45 'msg' => sprintf( __( 'You have been logged out. Please %slogin again%s.', 'ultimate-slider' ), '<a href="' . wp_login_url( admin_url( 'admin.php?page=ewd-us-dashboard' ) ) . '">', '</a>' ),
46 )
47 );
48 }
49
50 /**
51 * Handle ajax requests where an invalid nonce is passed with the request
52 * @since 2.0.9
53 */
54 public static function bad_nonce_ajax() {
55
56 wp_send_json_error(
57 array(
58 'error' => 'badnonce',
59 'msg' => __( 'The request has been rejected because it does not appear to have come from this site.', 'ultimate-slider' ),
60 )
61 );
62 }
63
64 /**
65 * Escapes PHP data being passed to JS, recursively
66 * @since 2.1.0
67 */
68 public static function escape_js_recursive( $values ) {
69
70 $return_values = array();
71
72 foreach ( (array) $values as $key => $value ) {
73
74 if ( is_array( $value ) ) {
75
76 $value = ewdusHelper::escape_js_recursive( $value );
77 }
78 elseif ( ! is_scalar( $value ) ) {
79
80 continue;
81 }
82 else {
83
84 $value = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
85 }
86
87 $return_values[ $key ] = $value;
88 }
89
90 return $return_values;
91 }
92 }
93
94 }