当前位置: 首页>>代码示例>>PHP>>正文


PHP TGM_Plugin_Activation::get_installed_version方法代码示例

本文整理汇总了PHP中TGM_Plugin_Activation::get_installed_version方法的典型用法代码示例。如果您正苦于以下问题:PHP TGM_Plugin_Activation::get_installed_version方法的具体用法?PHP TGM_Plugin_Activation::get_installed_version怎么用?PHP TGM_Plugin_Activation::get_installed_version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TGM_Plugin_Activation的用法示例。


在下文中一共展示了TGM_Plugin_Activation::get_installed_version方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _gather_plugin_data

 /**
  * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table.
  *
  * @since 2.2.0
  *
  * @return array $table_data Information for use in table.
  */
 protected function _gather_plugin_data()
 {
     // Load thickbox for plugin links.
     $this->tgmpa->admin_init();
     $this->tgmpa->thickbox();
     // Categorize the plugins which have open actions.
     $plugins = $this->categorize_plugins_to_views();
     // Set the counts for the view links.
     $this->set_view_totals($plugins);
     // Prep variables for use and grab list of all installed plugins.
     $table_data = array();
     $i = 0;
     // Redirect to the 'all' view if no plugins were found for the selected view context.
     if (empty($plugins[$this->view_context])) {
         $this->view_context = 'all';
     }
     foreach ($plugins[$this->view_context] as $slug => $plugin) {
         $table_data[$i]['sanitized_plugin'] = $plugin['name'];
         $table_data[$i]['slug'] = $slug;
         $table_data[$i]['plugin'] = '<strong>' . $this->tgmpa->get_info_link($slug) . '</strong>';
         $table_data[$i]['source'] = $this->get_plugin_source_type_text($plugin['source_type']);
         $table_data[$i]['type'] = $this->get_plugin_advise_type_text($plugin['required']);
         $table_data[$i]['status'] = $this->get_plugin_status_text($slug);
         $table_data[$i]['installed_version'] = $this->tgmpa->get_installed_version($slug);
         $table_data[$i]['minimum_version'] = $plugin['version'];
         $table_data[$i]['available_version'] = $this->tgmpa->does_plugin_have_update($slug);
         if (!empty($plugin['description'])) {
             $table_data[$i]['description'] = $plugin['description'];
         }
         // Prep the upgrade notice info.
         $upgrade_notice = $this->tgmpa->get_upgrade_notice($slug);
         if (!empty($upgrade_notice)) {
             $table_data[$i]['upgrade_notice'] = $upgrade_notice;
             add_action("tgmpa_after_plugin_row_{$slug}", array($this, 'wp_plugin_update_row'), 10, 2);
         }
         $table_data[$i] = apply_filters('tgmpa_table_data_item', $table_data[$i], $plugin);
         $i++;
     }
     return $table_data;
 }
开发者ID:bigpopakap,项目名称:clickworthy,代码行数:47,代码来源:plugin-activation.php


注:本文中的TGM_Plugin_Activation::get_installed_version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。