Beispiel #1
0
 /**
  * Initialize metabox list
  * 
  * @param string $post_type
  * 
  * @return void
  * 
  * @access public
  */
 public function initialize($post_type)
 {
     $cache = $this->getMetaboxList();
     if ($post_type === 'dashboard') {
         $this->collectWidgets($cache);
     } else {
         $this->collectMetaboxes($post_type, $cache);
     }
     AAM_Core_API::updateOption('aam_metabox_cache', $cache);
 }
Beispiel #2
0
 /**
  *
  * @param type $value
  * @param type $object
  * @param type $id
  * @return type
  */
 public function updateOption($value, $object, $id = 0)
 {
     return AAM_Core_API::updateOption($this->getOptionName($object, $id), $value);
 }
Beispiel #3
0
 /**
  * 
  * @return type
  */
 public function confirmWelcome()
 {
     return json_encode(array('status' => AAM_Core_API::updateOption('aam-welcome', 0)));
 }
Beispiel #4
0
 /**
  * Run daily routine
  * 
  * Check server extension versions
  * 
  * @return void
  * 
  * @access public
  */
 public static function cron()
 {
     //grab the server extension list
     $response = AAM_Core_Server::check();
     if (!empty($response)) {
         AAM_Core_API::updateOption('aam-extension-repository', $response);
     }
 }
Beispiel #5
0
 /**
  * Store the license key
  * 
  * This is important to have just for the update extension purposes
  * 
  * @param string $title
  * @param string $license
  * 
  * @return void
  * 
  * @access protected
  */
 protected function storeLicense($title, $license)
 {
     //retrieve the installed list of extensions
     $list = AAM_Core_API::getOption('aam-extension-license', array());
     $list[$title] = $license;
     //update the extension list
     AAM_Core_API::updateOption('aam-extension-license', $list);
 }
Beispiel #6
0
 /**
  * Run daily routine
  * 
  * Check server extension versions
  * 
  * @return void
  * 
  * @access public
  */
 public static function cron()
 {
     //grab the server extension list
     $response = AAM_Core_Server::check();
     if (!is_wp_error($response)) {
         AAM_Core_API::updateOption('aam-extension-list', $response);
     }
 }
Beispiel #7
0
 /**
  * Clear cache
  * 
  * @param AAM_Core_Subject $subject
  * 
  * @return void
  * 
  * @access public
  */
 public function clearCache(AAM_Core_Subject $subject)
 {
     if ($this->isCacheOn()) {
         $group = $subject->getUID() . '-' . $subject->getId();
         if (isset($this->cache[$group])) {
             unset($this->cache[$group]);
         }
         AAM_Core_API::updateOption('aam-cache', $this->cache);
     }
 }