本文整理汇总了PHP中get_mu_plugins函数的典型用法代码示例。如果您正苦于以下问题:PHP get_mu_plugins函数的具体用法?PHP get_mu_plugins怎么用?PHP get_mu_plugins使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_mu_plugins函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _get_must_use_plugins
private function _get_must_use_plugins()
{
if (!$this->plugins) {
$this->plugins = get_mu_plugins();
}
return $this->plugins;
}
示例2: status_all
protected function status_all()
{
$this->mu_plugins = get_mu_plugins();
$plugins = get_plugins();
$plugins = array_merge($plugins, $this->mu_plugins);
// Print the header
WP_CLI::line('Installed plugins:');
foreach ($plugins as $file => $plugin) {
if (false === strpos($file, '/')) {
$name = str_replace('.php', '', basename($file));
} else {
$name = dirname($file);
}
if ($this->get_update_status($file)) {
$line = ' %yU%n';
} else {
$line = ' ';
}
$line .= $this->get_status($file) . " {$name}%n";
WP_CLI::line($line);
}
// Print the footer
WP_CLI::line();
$legend = array('I' => 'Inactive', '%gA' => 'Active', '%cM' => 'Must Use');
if (is_multisite()) {
$legend['%bN'] = 'Network Active';
}
WP_CLI::legend($legend);
}
示例3: get_all_items
protected function get_all_items()
{
$items = $this->get_item_list();
foreach (get_mu_plugins() as $file => $mu_plugin) {
$items[$file] = array('name' => $this->get_name($file), 'status' => 'must-use', 'update' => false);
}
return $items;
}
示例4: updateCache
private function updateCache()
{
require_once ABSPATH . 'wp-admin/includes/plugin.php';
self::$autoPlugins = get_plugins(self::$relativePath);
self::$muPlugins = get_mu_plugins();
$plugins = array_diff_key(self::$autoPlugins, self::$muPlugins);
$rebuild = !is_array(self::$cache['plugins']);
self::$activated = $rebuild ? $plugins : array_diff_key($plugins, self::$cache['plugins']);
self::$cache = ['plugins' => $plugins, 'count' => $this->countPlugins()];
update_site_option('tagmeoAutoloader', self::$cache);
}
示例5: get_plugins_info
function get_plugins_info()
{
$plugins = $this->sitepress->get_wp_api()->get_plugins();
$active_plugins = $this->sitepress->get_wp_api()->get_option('active_plugins');
$active_plugins_info = array();
foreach ($active_plugins as $plugin) {
if (isset($plugins[$plugin])) {
unset($plugins[$plugin]['Description']);
$active_plugins_info[$plugin] = $plugins[$plugin];
}
}
$mu_plugins = get_mu_plugins();
$dropins = get_dropins();
$output = array('active_plugins' => $active_plugins_info, 'mu_plugins' => $mu_plugins, 'dropins' => $dropins);
return $output;
}
示例6: get_plugins_info
function get_plugins_info()
{
if (!function_exists('get_plugins')) {
$admin_includes_path = str_replace(site_url('/', 'admin'), ABSPATH, admin_url('includes/', 'admin'));
require_once $admin_includes_path . 'plugin.php';
}
$plugins = get_plugins();
$active_plugins = get_option('active_plugins');
$active_plugins_info = array();
foreach ($active_plugins as $plugin) {
if (isset($plugins[$plugin])) {
unset($plugins[$plugin]['Description']);
$active_plugins_info[$plugin] = $plugins[$plugin];
}
}
$mu_plugins = get_mu_plugins();
$dropins = get_dropins();
$output = array('active_plugins' => $active_plugins_info, 'mu_plugins' => $mu_plugins, 'dropins' => $dropins);
return $output;
}
示例7: status
/**
* Get the status of one or all plugins
*
* @param array $args
*/
function status($args = array(), $vars = array())
{
$this->mu_plugins = get_mu_plugins();
if (empty($args)) {
$this->list_plugins();
return;
}
list($file, $name) = $this->parse_name($args, __FUNCTION__);
$details = $this->get_details($file);
$status = $this->get_status($file, true);
$version = $details['Version'];
if (WP_CLI::get_update_status($file, 'update_plugins')) {
$version .= ' (%gUpdate available%n)';
}
WP_CLI::line('Plugin %9' . $name . '%n details:');
WP_CLI::line(' Name: ' . $details['Name']);
WP_CLI::line(' Status: ' . $status . '%n');
WP_CLI::line(' Version: ' . $version);
WP_CLI::line(' Author: ' . $details['Author']);
WP_CLI::line(' Description: ' . $details['Description']);
}
示例8: get_mu_plugins
/**
* Lists any "Must-use Plugins".
*
* @return array
*/
static function get_mu_plugins()
{
$mu_plugins = array();
if (function_exists('get_mu_plugins')) {
$mu_plugins_raw = get_mu_plugins();
foreach ($mu_plugins_raw as $k => $v) {
$plugin = $v['Name'];
if (!empty($v['Version'])) {
$plugin .= sprintf(' version %s', $v['Version']);
}
if (!empty($v['Author'])) {
$plugin .= sprintf(' by %s', $v['Author']);
}
if (!empty($v['AuthorURI'])) {
$plugin .= sprintf('(%s)', $v['AuthorURI']);
}
$mu_plugins[] = $plugin;
}
}
return $mu_plugins;
}
示例9: get_installed_plugins
/**
* Returns an array with the installed plugins
* @return array
*/
private function get_installed_plugins()
{
if (!function_exists('get_plugins')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$plugins = get_plugins();
// add the MU plugin details if any
$plugins['mu_plugins'] = get_mu_plugins();
return $plugins;
}
示例10: test_get_mu_plugins_should_ignore_files_without_php_extensions
/**
* @covers ::get_mu_plugins
*/
public function test_get_mu_plugins_should_ignore_files_without_php_extensions()
{
if (is_dir(WPMU_PLUGIN_DIR)) {
$exists = true;
$this->_back_up_mu_plugins();
} else {
$exists = false;
mkdir(WPMU_PLUGIN_DIR);
}
$this->_create_plugin('<?php\\n//Test', 'foo.php', WPMU_PLUGIN_DIR);
$this->_create_plugin('<?php\\n//Test 2', 'bar.txt', WPMU_PLUGIN_DIR);
$found = get_mu_plugins();
$this->assertEquals(array('foo.php'), array_keys($found));
// Clean up.
unlink(WPMU_PLUGIN_DIR . '/foo.php');
unlink(WPMU_PLUGIN_DIR . '/bar.txt');
if ($exists) {
$this->_restore_mu_plugins();
} else {
rmdir(WPMU_PLUGIN_DIR);
}
}
示例11: system_status
/**
* Generate the debug information content.
*
* @since 1.2.0
*
* @return string
*/
private function system_status()
{
if (!current_user_can('manage_options')) {
return '';
}
global $wpdb;
$theme_data = wp_get_theme();
$theme = $theme_data->Name . ' ' . $theme_data->Version;
ob_start();
?>
### Begin Custom Post Type UI Debug Info ###
Multisite: <?php
echo is_multisite() ? 'Yes' . "\n" : 'No' . "\n";
?>
SITE_URL: <?php
echo site_url() . "\n";
?>
HOME_URL: <?php
echo home_url() . "\n";
?>
WordPress Version: <?php
echo get_bloginfo('version') . "\n";
?>
Permalink Structure: <?php
echo get_option('permalink_structure') . "\n";
?>
Active Theme: <?php
echo $theme . "\n";
?>
Registered Post Types: <?php
echo implode(', ', get_post_types('', 'names')) . "\n";
?>
PHP Version: <?php
echo PHP_VERSION . "\n";
?>
MySQL Version: <?php
echo $wpdb->db_version() . "\n";
?>
Web Server Info: <?php
echo $_SERVER['SERVER_SOFTWARE'] . "\n";
?>
Show On Front: <?php
echo get_option('show_on_front') . "\n";
?>
Page On Front: <?php
$id = get_option('page_on_front');
echo get_the_title($id) . ' (#' . $id . ')' . "\n";
?>
Page For Posts: <?php
$id = get_option('page_for_posts');
echo get_the_title($id) . ' (#' . $id . ')' . "\n";
?>
WordPress Memory Limit: <?php
echo $this->num_convt(WP_MEMORY_LIMIT) / 1024 . 'MB';
echo "\n";
?>
<?php
$plugins = get_plugins();
$pg_count = count($plugins);
echo 'TOTAL PLUGINS: ' . $pg_count . "\n\n";
// MU plugins.
$mu_plugins = get_mu_plugins();
if ($mu_plugins) {
echo "\t\t" . 'MU PLUGINS: (' . count($mu_plugins) . ')' . "\n\n";
foreach ($mu_plugins as $mu_path => $mu_plugin) {
echo "\t\t" . $mu_plugin['Name'] . ': ' . $mu_plugin['Version'] . "\n";
}
}
// Standard plugins - active.
echo "\n";
$active = get_option('active_plugins', array());
$ac_count = count($active);
$ic_count = $pg_count - $ac_count;
echo "\t\t" . 'ACTIVE PLUGINS: (' . $ac_count . ')' . "\n\n";
foreach ($plugins as $plugin_path => $plugin) {
// If the plugin isn't active, don't show it.
if (!in_array($plugin_path, $active)) {
continue;
}
echo "\t\t" . $plugin['Name'] . ': ' . $plugin['Version'] . "\n";
}
// Standard plugins - inactive.
echo "\n";
echo "\t\t", 'INACTIVE PLUGINS: (' . $ic_count . ')' . "\n\n";
//.........这里部分代码省略.........
示例12: get_all_items
protected function get_all_items()
{
$items = $this->get_item_list();
foreach (get_mu_plugins() as $file => $mu_plugin) {
$mu_version = '';
if (!empty($mu_plugin['Version'])) {
$mu_version = $mu_plugin['Version'];
}
$items[$file] = array('name' => Utils\get_plugin_name($file), 'status' => 'must-use', 'update' => false, 'update_version' => NULL, 'update_package' => NULL, 'version' => $mu_version, 'update_id' => '', 'title' => '', 'description' => '');
}
return $items;
}
示例13: prepare_items
function prepare_items()
{
global $status, $plugins, $totals, $page, $orderby, $order, $s;
wp_reset_vars(array('orderby', 'order', 's'));
$plugins = array('all' => apply_filters('all_plugins', get_plugins()), 'search' => array(), 'active' => array(), 'inactive' => array(), 'recently_activated' => array(), 'upgrade' => array(), 'mustuse' => array(), 'dropins' => array());
$screen = get_current_screen();
if (!is_multisite() || $screen->is_network && current_user_can('manage_network_plugins')) {
if (apply_filters('show_advanced_plugins', true, 'mustuse')) {
$plugins['mustuse'] = get_mu_plugins();
}
if (apply_filters('show_advanced_plugins', true, 'dropins')) {
$plugins['dropins'] = get_dropins();
}
$current = get_site_transient('update_plugins');
foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
if (isset($current->response[$plugin_file])) {
$plugins['upgrade'][$plugin_file] = $plugin_data;
}
}
}
set_transient('plugin_slugs', array_keys($plugins['all']), 86400);
$recently_activated = get_option('recently_activated', array());
$one_week = 7 * 24 * 60 * 60;
foreach ($recently_activated as $key => $time) {
if ($time + $one_week < time()) {
unset($recently_activated[$key]);
}
}
update_option('recently_activated', $recently_activated);
foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
// Filter into individual sections
if (is_multisite() && is_network_only_plugin($plugin_file) && !$screen->is_network) {
unset($plugins['all'][$plugin_file]);
} elseif (is_plugin_active_for_network($plugin_file) && !$screen->is_network) {
unset($plugins['all'][$plugin_file]);
} elseif (is_multisite() && is_network_only_plugin($plugin_file) && !current_user_can('manage_network_plugins')) {
$plugins['network'][$plugin_file] = $plugin_data;
} elseif (!$screen->is_network && is_plugin_active($plugin_file) || $screen->is_network && is_plugin_active_for_network($plugin_file)) {
$plugins['active'][$plugin_file] = $plugin_data;
} else {
if (!$screen->is_network && isset($recently_activated[$plugin_file])) {
// Was the plugin recently activated?
$plugins['recently_activated'][$plugin_file] = $plugin_data;
}
$plugins['inactive'][$plugin_file] = $plugin_data;
}
}
if (!current_user_can('update_plugins')) {
$plugins['upgrade'] = array();
}
if ($s) {
$status = 'search';
$plugins['search'] = array_filter($plugins['all'], array(&$this, '_search_callback'));
}
$totals = array();
foreach ($plugins as $type => $list) {
$totals[$type] = count($list);
}
if (empty($plugins[$status]) && !in_array($status, array('all', 'search'))) {
$status = 'all';
}
$this->items = array();
foreach ($plugins[$status] as $plugin_file => $plugin_data) {
// Translate, Don't Apply Markup, Sanitize HTML
$this->items[$plugin_file] = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true);
}
$total_this_page = $totals[$status];
if ($orderby) {
$orderby = ucfirst($orderby);
$order = strtoupper($order);
uasort($this->items, array(&$this, '_order_callback'));
}
$plugins_per_page = $this->get_items_per_page(str_replace('-', '_', $screen->id . '_per_page'));
$start = ($page - 1) * $plugins_per_page;
if ($total_this_page > $plugins_per_page) {
$this->items = array_slice($this->items, $start, $plugins_per_page);
}
$this->set_pagination_args(array('total_items' => $total_this_page, 'per_page' => $plugins_per_page));
}
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:79,代码来源:class-wp-plugins-list-table.php
示例14: get_plugin_updates
Template Path Exists: <?php
echo cnFormatting::toYesNo(is_dir(CN_CUSTOM_TEMPLATE_PATH)) . PHP_EOL;
?>
Template Path Writeable: <?php
echo cnFormatting::toYesNo(is_writeable(CN_CUSTOM_TEMPLATE_PATH)) . PHP_EOL;
?>
Cache Path Exists: <?php
echo cnFormatting::toYesNo(is_dir(CN_CACHE_PATH)) . PHP_EOL;
?>
Cache Path Writeable: <?php
echo cnFormatting::toYesNo(is_writeable(CN_CACHE_PATH)) . PHP_EOL;
// Get plugins that have an update
$updates = get_plugin_updates();
// Must-use plugins
$muplugins = get_mu_plugins();
if (0 < count($muplugins)) {
?>
-- Must-Use Plugins
<?php
foreach ($muplugins as $plugin => $plugin_data) {
echo $plugin_data['Name'] . ': ' . $plugin_data['Version'] . PHP_EOL;
}
do_action('cn_sysinfo_after_wordpress_mu_plugins');
}
?>
-- WordPress Active Plugins
<?php
示例15: esc_html_e
?>
</th>
<th><?php
esc_html_e('Description', 'it-l10n-backupbuddy');
?>
</th>
<th><?php
esc_html_e('Plugin Type', 'it-l10n-backupbuddy');
?>
</th>
</tr>
</tfoot>
<tbody id="pb_reorder">
<?php
//Get MU Plugins
foreach (get_mu_plugins() as $file => $meta) {
$description = !empty($meta['Description']) ? $meta['Description'] : '';
$name = !empty($meta['Name']) ? $meta['Name'] : $file;
?>
<tr>
<th scope="row" class="check-column"><input type="checkbox" name="items[mu][]" class="entries" value="<?php
echo esc_attr($file);
?>
" /></th>
<td><?php
echo esc_html($name);
?>
</td>
<td><?php
echo esc_html($description);
?>