예제 #1
0
 /**
  * Handles options presetting on first install / activation
  * @param IfwPsn_Wp_Plugin_Manager $pm
  */
 protected function _presetOptions(IfwPsn_Wp_Plugin_Manager $pm)
 {
     if (!$pm->hasOption('selftest_timestamp')) {
         // on first install (no selftest timestam could be found)
         $pm->getOptions()->updateOption('psn_ignore_status_inherit', true);
     }
 }
예제 #2
0
파일: Manager.php 프로젝트: jasmun/Noco100
 /**
  * @param $id
  * @return mixed|null
  */
 public function getOption($id)
 {
     if ($this->hasOption($id)) {
         $options = IfwPsn_Wp_Proxy::getOption($this->_pm->getOptions()->getPageId());
         return $options[$this->_pm->getOptions()->getOptionRealId($id)];
     }
     return null;
 }
예제 #3
0
 /**
  * @param IfwPsn_Wp_Plugin_Manager|null $pm
  * @return mixed|void
  */
 public static function execute($pm)
 {
     if (!$pm instanceof IfwPsn_Wp_Plugin_Manager) {
         return;
     }
     if (IfwPsn_Wp_Proxy_Blog::isMultisite()) {
         // multisite installation
         $currentBlogId = IfwPsn_Wp_Proxy_Blog::getBlogId();
         foreach (IfwPsn_Wp_Proxy_Blog::getMultisiteBlogIds() as $blogId) {
             IfwPsn_Wp_Proxy_Blog::switchToBlog($blogId);
             $pm->getOptions()->reset();
         }
         IfwPsn_Wp_Proxy_Blog::switchToBlog($currentBlogId);
     } else {
         // single blog installation
         $pm->getOptions()->reset();
     }
 }