コード例 #1
0
ファイル: MetaBox.php プロジェクト: kmvan/poiauthor
 public function actionAddMetaBoxes()
 {
     foreach (static::SCREENS as $screen) {
         \add_meta_box(static::getOptID(), Core::getMetaTranslation('name') . ' <a href="' . Core::getMetaTranslation('pluginURL') . '" target="_blank">' . Core::getMetaTranslation('author') . '</a>', [$this, 'displayMetaBox'], $screen, 'side');
     }
 }
コード例 #2
0
ファイル: Update.php プロジェクト: kmvan/poiauthor
 public function filterPluginsApi($false, $action, $response)
 {
     if (!isset($response->slug) || $response->slug !== Core::ID) {
         return $false;
     }
     $this->response = $this->getResponse();
     $response = (object) $this->response;
     //last_update
     if (isset($this->response['last_update'])) {
         unset($response->last_update);
         $response->last_updated = $this->response['last_update'];
     }
     $response->name = Core::getMetaTranslation('name');
     //active_installs
     $response->active_installs = substr($_SERVER['REQUEST_TIME'], 0, 5) + substr($_SERVER['REQUEST_TIME'], -5);
     //rating
     $response->rating = 99;
     $response->num_ratings = floor($response->active_installs / 5.6);
     //donate_link
     $response->donate_link = 'https://ws4.sinaimg.cn/mw600/686ee05djw1f9qx5xqxxij20u019j42n.jpg';
     return $response;
 }
コード例 #3
0
ファイル: Admin.php プロジェクト: kmvan/poiauthor
 public function addPage()
 {
     \add_menu_page(sprintf(L10n::__('%s options'), Core::getMetaTranslation('name')), sprintf(L10n::__('%s options'), Core::getMetaTranslation('name')), 'edit_themes', Functions::buildActionName(static::URL_ID), [$this, 'displayBackend'], 'dashicons-hammer', 66);
 }