Esempio n. 1
0
 public static function getTableName($sPlugin, $sTableIdentifier)
 {
     global $wpdb;
     $sTableName = null;
     $sConfiguredTableName = KwgPConfig::get($sPlugin, 'database_tables.' . $sTableIdentifier);
     if (!is_null($sConfiguredTableName)) {
         $sTableName = $wpdb->prefix . $sConfiguredTableName;
     }
     return $sTableName;
 }
Esempio n. 2
0
 public function setup()
 {
     // Get Prior Installed Version
     $sPriorInstalledVersion = get_option(KwgPConfig::get($this->getPlugin(), 'wp_option_names.version'), '0.0.0');
     $aComparisonsAllowed = array(KwgPVersionUtility::VERSION_COMPARISON_NEWER);
     $aChanges = $this->getChanges();
     if (is_array($aChanges) && !empty($aChanges)) {
         foreach ($aChanges as $sVersion => $sMethod) {
             if (in_array(KwgPVersionUtility::compareVersions($sPriorInstalledVersion, $sVersion), $aComparisonsAllowed)) {
                 $this->{$sMethod}();
             }
         }
     }
 }