YIT_Ajax

YIT Ajax.

Defined (1)

The class is defined in the following location(s).

/plugin-fw/lib/yit-ajax.php  
  1. class YIT_Ajax { 
  2. /** 
  3. * @var string version of class 
  4. */ 
  5. public $version = '1.0.0'; 
  6.  
  7. /** 
  8. * @var object The single instance of the class 
  9. * @since 1.0 
  10. */ 
  11. protected static $_instance = null; 
  12.  
  13. /** 
  14. * Constructor 
  15. * @since 1.0 
  16. * @author Leanza Francesco <leanzafrancesco@gmail.com> 
  17. */ 
  18. private function __construct() { 
  19. add_action( 'wp_ajax_yith_plugin_panel_sidebar_set_collapse_option', array( $this, 'set_ajax_sidebar_collapse_option' ) ); 
  20.  
  21. /** 
  22. * get single instance 
  23. * @static 
  24. * @return YIT_Ajax 
  25. * @since 1.0 
  26. * @author Leanza Francesco <leanzafrancesco@gmail.com> 
  27. */ 
  28. public static function instance() { 
  29. if ( is_null( self::$_instance ) ) { 
  30. self::$_instance = new self(); 
  31.  
  32. return self::$_instance; 
  33.  
  34. /** 
  35. * Set Sidebar collapse option [AJAX] 
  36. */ 
  37. public function set_ajax_sidebar_collapse_option() { 
  38. if ( isset( $_REQUEST[ 'option' ] ) ) { 
  39. $option = $_REQUEST[ 'option' ]; 
  40. update_option( YIT_Plugin_Panel_Sidebar::$collapse_option, $option ); 
  41. die();