Example #1
0
 public static function checkPostTrigger()
 {
     $postId = get_option(CocoPostMetaStore::$backupKey);
     if ($postId != false) {
         CocoPostMetaStore::$postId = $postId;
         update_option(CocoPostMetaStore::$backupKey, false);
     }
 }
Example #2
0
 public function __construct($prefix = '', $autoForm = true, $autoNonce = true, $useStore = 'auto')
 {
     $this->autoForm = $autoForm;
     if ($useStore === 'auto') {
         $storeClass = CocoPostMetaStore::isPostContext() ? 'CocoPostMetaStore' : 'CocoOptionStore';
     } else {
         $storeClass = $useStore;
     }
     //@TODO : check if custom store implements store interface
     $this->store = new $storeClass();
     $this->store->setPrefix($prefix);
     if ($this->autoForm) {
         $this->startWrapper('form');
     }
     if ($autoNonce) {
         $this->nonce();
     }
 }