PluginProbe
Ultimate Lightbox / trunk
Ultimate Lightbox vtrunk
1.1.12 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.1.1 1.1.10 1.1.11 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9
ultimate-lightbox / includes / Helper.class.php

Helper.class.php in Ultimate Lightbox trunk, at includes/Helper.class.php

65 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( !defined( 'ABSPATH' ) ) exit;
3
4 if ( !class_exists( 'ewdulbHelper' ) ) {
5 /**
6 * Class to to provide helper functions
7 *
8 * @since 1.0.5
9 */
10 class ewdulbHelper {
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 ewdulbHelper();
31 }
32
33 return self::$instance;
34 }
35
36 /**
37 * Handle ajax requests in admin area for logged out users
38 * @since 1.0.5
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-lightbox' ), '<a href="' . wp_login_url( admin_url( 'admin.php?page=ewd-ulb-dashboard' ) ) . '">', '</a>' ),
46 )
47 );
48 }
49
50 /**
51 * Handle ajax requests where an invalid nonce is passed with the request
52 * @since 1.0.5
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-lightbox' ),
60 )
61 );
62 }
63 }
64
65 }