• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_get_active_and_valid_plugins函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_get_active_and_valid_plugins函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_get_active_and_valid_plugins函数的具体用法?PHP wp_get_active_and_valid_plugins怎么用?PHP wp_get_active_and_valid_plugins使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: bp_is_installed

 /**
  * Determines whether or not BuddyPress is installed.
  *
  * @package s2Member\Utilities
  * @since 110720
  *
  * @param bool $query_active_plugins Optional. If true, this conditional will query active plugins too. Defaults to true if {@link s2Member\WS_PLUGIN__S2MEMBER_ONLY} is true, else false.
  * @return bool True if BuddyPress is installed, else false.
  */
 public static function bp_is_installed($query_active_plugins = NULL)
 {
     if (defined("BP_VERSION") && did_action("bp_core_loaded")) {
         return true;
     }
     /* Quickest/easiest way to determine. */
     /**/
     $s2o = defined("WS_PLUGIN__S2MEMBER_ONLY") && WS_PLUGIN__S2MEMBER_ONLY ? true : false;
     /**/
     if ($query_active_plugins = !isset($query_active_plugins) && $s2o ? true : $query_active_plugins) {
         $buddypress = "buddypress/bp-loader.php";
         /* BuddyPress. */
         /**/
         $active_plugins = is_multisite() ? wp_get_active_network_plugins() : array();
         $active_plugins = array_unique(array_merge($active_plugins, wp_get_active_and_valid_plugins()));
         /**/
         foreach ($active_plugins as $active_plugin) {
             /* Search. */
             if (plugin_basename($active_plugin) === $buddypress) {
                 return true;
             }
         }
         /* BuddyPress active. */
     }
     return false;
     /* Default return false. */
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:36,代码来源:utils-conds.inc.php


示例2: collect_data

 private function collect_data()
 {
     $active_plugins = wp_get_active_and_valid_plugins();
     $this->init_bundle($active_plugins);
     foreach ($active_plugins as $plugin) {
         $this->add_installed_plugin($plugin);
     }
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:8,代码来源:class-wpml-dependencies.php


示例3: generateSupportHash

 /**
  * Generate a hash with all the system support information
  *
  * @return string of encoded support info
  * @author Peter Chester
  */
 public static function generateSupportHash()
 {
     $user = wp_get_current_user();
     $plugins_raw = wp_get_active_and_valid_plugins();
     $plugins = array();
     foreach ($plugins_raw as $k => $v) {
         $plugins[] = basename($v);
     }
     $systeminfo = array('URL' => 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'], 'NAME' => $user->display_name, 'EMAIL' => $user->user_email, 'PLUGIN VERSION' => TribeEvents::VERSION, 'WORDPRESS VERSION' => get_bloginfo('version'), 'PHP VERSION' => phpversion(), 'PLUGINS' => $plugins, 'THEME' => get_current_theme(), 'MU INSTALL' => is_multisite() ? 'TRUE' : 'FALSE', 'SETTINGS' => TribeEvents::getOptions(), 'ERRORS' => self::$debug_log);
     $systeminfo = apply_filters('tribe-events-pro-support', $systeminfo);
     $systeminfo = serialize($systeminfo);
     $systeminfo = base64_encode($systeminfo);
     return $systeminfo;
 }
开发者ID:mpaskew,项目名称:isc-dev,代码行数:20,代码来源:tribe-support.class.php


示例4: get_plugins_with_prefix

 /**
  * Get list of active plugins with a given prefix in the plugin folder path.
  *
  * @param string|array $prefix Prefixes you want to retrieve.
  *
  * @return array List of plugins with prefix in path.
  */
 public static function get_plugins_with_prefix($prefix)
 {
     $full_list = wp_get_active_and_valid_plugins();
     if (is_multisite()) {
         $full_list = array_merge($full_list, wp_get_active_network_plugins());
     }
     $filtered_list = array();
     foreach ($full_list as $plugin) {
         $base = plugin_basename($plugin);
         if (0 === Tribe__Utils__Array::strpos($base, $prefix)) {
             $filtered_list[] = $plugin;
         }
     }
     return $filtered_list;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:22,代码来源:Plugins.php


示例5: get_plugin_details

 public static function get_plugin_details($args = array())
 {
     if (!is_callable('get_plugins')) {
         include_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     if (!is_callable('get_plugins')) {
         return false;
     }
     $plugins = get_plugins();
     $active_plugins = is_callable('wp_get_active_and_valid_plugins') ? wp_get_active_and_valid_plugins() : array();
     $network_active_plugins = is_callable('wp_get_active_network_plugins') ? wp_get_active_network_plugins() : array();
     //		$mu_plugins = ( is_callable( 'get_mu_plugins' ) ) ? get_mu_plugins() : array();
     //		$dropins = ( is_callable( 'get_dropins' ) ) ? get_dropins() : array();
     array_walk($active_plugins, array(__CLASS__, 'strip_plugin_dir'));
     array_walk($network_active_plugins, array(__CLASS__, 'strip_plugin_dir'));
     foreach ($plugins as $plugin => $data) {
         if (in_array($plugin, $active_plugins)) {
             $plugins[$plugin]['status'] = 'active';
         } else {
             if (in_array($plugin, $network_active_plugins)) {
                 $plugins[$plugin]['status'] = 'network_active';
             } else {
                 $plugins[$plugin]['status'] = 'inactive';
             }
         }
         if (empty($args['verbose'])) {
             unset($plugins[$plugin]['PluginURI']);
             unset($plugins[$plugin]['Description']);
             unset($plugins[$plugin]['Author']);
             unset($plugins[$plugin]['AuthorURI']);
             unset($plugins[$plugin]['TextDomain']);
             unset($plugins[$plugin]['DomainPath']);
             unset($plugins[$plugin]['Title']);
             unset($plugins[$plugin]['AuthorName']);
         } else {
             $path = WP_PLUGIN_DIR . '/' . dirname($plugin);
             $vcs_details = self::get_repository_directory_details($path);
             if (false !== $vcs_details) {
                 $plugins[$plugin]['vcs'] = $vcs_details;
             }
         }
     }
     return $plugins;
 }
开发者ID:jimlongo56,项目名称:rdiv,代码行数:44,代码来源:functions.php


示例6: get_plugins

 /**
  * Lists any non-multisite plugins.
  *
  * @return array
  */
 static function get_plugins()
 {
     $plugins = array();
     if (function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_and_valid_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $plugins[] = $plugin;
         }
     }
     return $plugins;
 }
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:27,代码来源:Support.php


示例7: podpress_wp_e_commerce_compatibility

function podpress_wp_e_commerce_compatibility()
{
    global $wp_version;
    $wp_ecommerce_is_active = FALSE;
    if (version_compare($wp_version, '3.0', '<')) {
        $current_plugins = get_option('active_plugins');
    } else {
        $current_plugins = wp_get_active_and_valid_plugins();
    }
    if (TRUE === is_array($current_plugins)) {
        foreach ($current_plugins as $current_plugin) {
            if (FALSE !== stripos($current_plugin, 'wp-shopping-cart.php')) {
                $wp_ecommerce_is_active = TRUE;
                break;
            }
        }
    }
    if (TRUE === $wp_ecommerce_is_active) {
        if (!defined('PODPRESS_WP_ECOMMERCE_IS_ACTIVE')) {
            define('PODPRESS_WP_ECOMMERCE_IS_ACTIVE', TRUE);
        }
    }
}
开发者ID:KimcoBlogSC,项目名称:Blog,代码行数:23,代码来源:podpress_wp_e-commerce_compatibility.php


示例8: _pp_support_upload

function _pp_support_upload($args = array())
{
    require_once dirname(__FILE__) . '/plugin_pp.php';
    //$args['post_id'] = 1;
    //$args['term_taxonomy_id'] = 1;
    $request_vars = array('site' => site_url(''));
    global $wpdb;
    $ok = (array) pp_get_option('support_data');
    $pp_config = array();
    $pp_old = array();
    //if ( ! empty( $ok['pp_options'] ) ) {
    global $pp_site_options;
    $options = array();
    foreach (array('default_category', 'permalink_structure', '_bbp_default_role', '_bbp_private_forums', '_bbp_use_wp_editor', '_bbp_allow_anonymous', '_bbp_allow_global_access', '_bbp_db_version', 'bp-active-components', 'users_can_register', 'comment_moderation', 'comment_registration', 'registration', 'default_role', 'db_version', 'enable_app', 'enable_xmlrpc', 'sticky_posts', 'initial_db_version') as $opt) {
        $options[$opt] = get_option($opt);
    }
    ksort($options);
    $pp_config['options'] = gzcompress(serialize($options));
    ksort($pp_site_options);
    $pp_config['pp_options'] = gzcompress(serialize($pp_site_options));
    $pp_config['rvy_options'] = gzcompress(serialize($wpdb->get_results("SELECT option_name, option_value, option_id FROM {$wpdb->options} WHERE option_name LIKE 'rvy_%' ORDER BY option_name", ARRAY_N)));
    if (PP_MULTISITE) {
        global $pp_netwide_options, $pp_net_options;
        if (is_array($pp_net_options)) {
            ksort($pp_net_options);
            if (!empty($pp_net_options)) {
                $pp_config['pp_net_options'] = gzcompress(serialize($pp_net_options));
            }
        }
        ksort($pp_netwide_options);
        if (!empty($pp_netwide_options)) {
            $pp_config['pp_netwide_options'] = gzcompress(serialize($pp_netwide_options));
        }
        $sitemeta_table = $wpdb->base_prefix . 'sitemeta';
        if ($rvy_net_options = $wpdb->get_results("SELECT meta_key, meta_value, site_id, meta_id FROM {$sitemeta_table} WHERE meta_key LIKE 'rvy_%' ORDER BY meta_key", ARRAY_N)) {
            $pp_config['rvy_net_options'] = gzcompress(serialize($rvy_net_options));
        }
    }
    //}
    if (!empty($ok['wp_roles_types'])) {
        global $wp_post_types, $wp_taxonomies, $wp_post_statuses, $wp_roles;
        // strip labels, label_count props
        $pp_config['wp_roles'] = gzcompress(serialize($wp_roles));
        // strip out labels and some other properties for perf
        foreach (array('wp_post_types', 'wp_taxonomies', 'wp_post_statuses') as $var) {
            $wp_data = ${$var};
            $arr = array();
            foreach (array_keys($wp_data) as $member) {
                $arr[$member] = array();
                foreach (array_keys(get_object_vars($wp_data[$member])) as $prop) {
                    if (!in_array($prop, array('labels', 'label_count', 'can_export', 'description'))) {
                        $arr[$member][$prop] = $wp_data[$member]->{$prop};
                    }
                }
            }
            $pp_config[$var] = gzcompress(serialize($arr));
        }
    }
    if (!empty($ok['theme'])) {
        $th = wp_get_theme();
        $theme_data = array();
        foreach (array('name', 'title', 'version', 'parent_theme', 'template') as $prop) {
            $theme_data[$prop] = $th->{$prop};
        }
        $theme_data['errors'] = $th->errors();
        $pp_config['theme'] = gzcompress(serialize($theme_data));
        $pp_config['widgets'] = gzcompress(serialize((array) get_option('sidebars_widgets')));
    }
    if (file_exists(ABSPATH . 'wp-admin/includes/plugin.php')) {
        include_once ABSPATH . 'wp-admin/includes/plugin.php';
    }
    if (!empty($ok['active_plugins']) && function_exists('get_plugin_data')) {
        $active_plugins = array();
        foreach (wp_get_active_and_valid_plugins() as $file) {
            // reduce to relative path for privacy
            $slug = array();
            if ($part = @basename(dirname(dirname(dirname($file))))) {
                $slug[] = $part;
            }
            if ($part = @basename(dirname(dirname($file)))) {
                $slug[] = $part;
            }
            if ($part = @basename(dirname($file))) {
                $slug[] = $part;
            }
            $slug[] = basename($file);
            $slug = implode('/', $slug);
            $active_plugins[$slug] = array_diff_key(get_plugin_data($file), array_fill_keys(array('Author', 'AuthorURI', 'TextDomain', 'DomainPath', 'Title', 'AuthorName', 'Description'), true));
        }
        $pp_config['active_plugins'] = gzcompress(serialize($active_plugins));
        if (function_exists('get_dropins')) {
            $pp_config['dropins'] = gzcompress(serialize(get_dropins()));
        }
    }
    if (!empty($ok['installed_plugins']) && function_exists('get_plugins')) {
        if ($installed_plugins = get_plugins()) {
            foreach (array_keys($installed_plugins) as $key) {
                $installed_plugins[$key] = array_diff_key($installed_plugins[$key], array_fill_keys(array('Author', 'AuthorURI', 'TextDomain', 'DomainPath', 'Title', 'AuthorName', 'Description', 'PluginURI', 'Network'), true));
            }
            $pp_config['installed_plugins'] = gzcompress(serialize($installed_plugins));
//.........这里部分代码省略.........
开发者ID:severnrescue,项目名称:web,代码行数:101,代码来源:support_pp.php


示例9: init_plugins

 private function init_plugins()
 {
     if (!isset($this->installed_plugins) || !$this->installed_plugins) {
         if (!function_exists('get_plugin_data')) {
             include_once ABSPATH . '/wp-admin/includes/plugin.php';
         }
         if (function_exists('get_plugin_data')) {
             $active_plugins = wp_get_active_and_valid_plugins();
             foreach ($active_plugins as $plugin) {
                 $this->add_installed_plugin($plugin);
             }
         }
     }
 }
开发者ID:edgarter,项目名称:wecare,代码行数:14,代码来源:wpml-bundle-check.class.php


示例10: layers_get_plugins

 function layers_get_plugins()
 {
     $active_plugins = wp_get_active_and_valid_plugins();
     $layers_plugins = array();
     foreach ((array) $active_plugins as $plugin_key) {
         $plugin_data = get_plugin_data($plugin_key);
         if (isset($plugin_data['Layers Plugin']) && 'true' == strtolower($plugin_data['Layers Plugin'])) {
             $layers_plugins[$plugin_key] = $plugin_data;
         }
     }
     return $layers_plugins;
 }
开发者ID:maheshwaghmare,项目名称:layerswp,代码行数:12,代码来源:extensions.php


示例11: vp_register_hooks

function vp_register_hooks()
{
    global $versionPressContainer;
    /** @var Committer $committer */
    $committer = $versionPressContainer->resolve(VersionPressServices::COMMITTER);
    /** @var Mirror $mirror */
    $mirror = $versionPressContainer->resolve(VersionPressServices::MIRROR);
    /** @var DbSchemaInfo $dbSchemaInfo */
    $dbSchemaInfo = $versionPressContainer->resolve(VersionPressServices::DB_SCHEMA);
    /** @var VpidRepository $vpidRepository */
    $vpidRepository = $versionPressContainer->resolve(VersionPressServices::VPID_REPOSITORY);
    /** @var WpdbMirrorBridge $wpdbMirrorBridge */
    $wpdbMirrorBridge = $versionPressContainer->resolve(VersionPressServices::WPDB_MIRROR_BRIDGE);
    /** @var \VersionPress\Database\Database $database */
    $database = $versionPressContainer->resolve(VersionPressServices::DATABASE);
    /** @var ActionsInfoProvider $actionsInfoProvider */
    $actionsInfoProvider = $versionPressContainer->resolve(VersionPressServices::ACTIONSINFO_PROVIDER_ACTIVE_PLUGINS);
    if (!function_exists('get_plugins')) {
        require_once ABSPATH . 'wp-admin/includes/plugin.php';
    }
    $plugins = wp_get_active_and_valid_plugins();
    foreach ($plugins as $pluginFile) {
        $pluginDir = dirname($pluginFile);
        $hooksFile = $pluginDir . '/.versionpress/hooks.php';
        if (file_exists($hooksFile)) {
            require_once $hooksFile;
        }
    }
    add_filter('update_feedback', function () {
        touch(ABSPATH . 'versionpress.maintenance');
    });
    WordPressMissingFunctions::pipeAction('_core_updated_successfully', 'vp_wordpress_updated');
    add_action('activated_plugin', function ($pluginFile) {
        $plugins = get_plugins();
        $pluginName = $plugins[$pluginFile]['Name'];
        do_action('vp_plugin_changed', 'activate', $pluginFile, $pluginName);
    });
    add_action('deactivated_plugin', function ($pluginFile) {
        $plugins = get_plugins();
        $pluginName = $plugins[$pluginFile]['Name'];
        do_action('vp_plugin_changed', 'deactivate', $pluginFile, $pluginName);
    });
    add_action('upgrader_process_complete', function ($upgrader, $hook_extra) {
        if ($hook_extra['type'] === 'theme') {
            $themes = isset($hook_extra['bulk']) && $hook_extra['bulk'] === true ? $hook_extra['themes'] : [$upgrader->result['destination_name']];
            foreach ($themes as $stylesheet) {
                $themeName = wp_get_theme($stylesheet)->get('Name');
                if ($themeName === $stylesheet && isset($upgrader->skin->api, $upgrader->skin->api->name)) {
                    $themeName = $upgrader->skin->api->name;
                }
                // action can be "install" or "update", see WP_Upgrader and search for `'hook_extra' =>`
                $action = $hook_extra['action'];
                do_action('vp_theme_changed', $action, $stylesheet, $themeName);
            }
        }
        if (!($hook_extra['type'] === 'plugin' && $hook_extra['action'] === 'update')) {
            return;
            // handled by different hook
        }
        if (isset($hook_extra['bulk']) && $hook_extra['bulk'] === true) {
            $pluginFiles = $hook_extra['plugins'];
        } else {
            $pluginFiles = [$hook_extra['plugin']];
        }
        $plugins = get_plugins();
        foreach ($pluginFiles as $pluginFile) {
            $pluginName = $plugins[$pluginFile]['Name'];
            do_action('vp_plugin_changed', 'update', $pluginFile, $pluginName);
        }
    }, 10, 2);
    add_filter('upgrader_pre_install', function ($_, $hook_extra) {
        if (!(isset($hook_extra['type']) && $hook_extra['type'] === 'plugin' && $hook_extra['action'] === 'install')) {
            return;
        }
        $pluginsBeforeInstallation = get_plugins();
        $postInstallHook = function ($_, $hook_extra) use($pluginsBeforeInstallation, &$postInstallHook) {
            if (!($hook_extra['type'] === 'plugin' && $hook_extra['action'] === 'install')) {
                return;
            }
            wp_cache_delete('plugins', 'plugins');
            $pluginsAfterInstallation = get_plugins();
            $installedPlugins = array_diff_key($pluginsAfterInstallation, $pluginsBeforeInstallation);
            foreach ($installedPlugins as $pluginFile => $plugin) {
                do_action('vp_plugin_changed', 'install', $pluginFile, $plugin['Name']);
            }
            remove_filter('upgrader_post_install', $postInstallHook);
        };
        add_filter('upgrader_post_install', $postInstallHook, 10, 2);
    }, 10, 2);
    add_filter('upgrader_pre_download', function ($reply, $_, $upgrader) use($committer) {
        if (!isset($upgrader->skin->language_update)) {
            return $reply;
        }
        $languages = get_available_languages();
        $postInstallHook = function ($_, $hook_extra) use($committer, $languages, &$postInstallHook) {
            if (!isset($hook_extra['language_update_type'])) {
                return;
            }
            $type = $hook_extra['language_update_type'];
            $languageCode = $hook_extra['language_update']->language;
//.........这里部分代码省略.........
开发者ID:versionpress,项目名称:versionpress,代码行数:101,代码来源:setup-hooks.php


示例12: get_active_plugins

 /**
  * Return array of active plugins for current instance
  *
  * Improvement over wp_get_active_and_valid_plugins() which doesn't return any plugins when in MS
  *
  * @method get_active_plugins
  * @for Utility
  *
  * @since 0.2.0
  */
 public static function get_active_plugins()
 {
     $mu_plugins = (array) wp_get_mu_plugins();
     $regular_plugins = (array) wp_get_active_and_valid_plugins();
     if (is_multisite()) {
         $network_plugins = (array) wp_get_active_network_plugins();
     } else {
         $network_plugins = array();
     }
     return array_merge($regular_plugins, $mu_plugins, $network_plugins);
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:21,代码来源:class-utility.php


示例13: get_related_plugins_and_extensions

 /**
  * Get active GravityView Extensions and Gravity Forms Add-ons to help debug issues.
  *
  * @since 1.15
  * @return string List of active extensions related to GravityView or Gravity Forms, separated by HTML line breaks
  */
 private static function get_related_plugins_and_extensions()
 {
     if (!function_exists('wp_get_active_and_valid_plugins')) {
         return 'Running < WP 3.0';
     }
     $extensions = get_site_transient(self::related_plugins_key);
     if (empty($extensions)) {
         $active_plugins = wp_get_active_and_valid_plugins();
         $extensions = array();
         foreach ($active_plugins as $active_plugin) {
             // Match gravityview, gravity-forms, gravityforms, gravitate
             if (!preg_match('/(gravityview|gravity-?forms|gravitate)/ism', $active_plugin)) {
                 continue;
             }
             $plugin_data = get_plugin_data($active_plugin);
             $extensions[] = sprintf('%s %s', $plugin_data['Name'], $plugin_data['Version']);
         }
         if (!empty($extensions)) {
             set_site_transient(self::related_plugins_key, $extensions, HOUR_IN_SECONDS);
         } else {
             return 'There was an error fetching related plugins.';
         }
     }
     return implode('<br />', $extensions);
 }
开发者ID:mgratch,项目名称:GravityView,代码行数:31,代码来源:class-gravityview-support-port.php


示例14: getSupportStats

 /**
  * Collect system information for support
  *
  * @return array of system data for support
  * @author Peter Chester
  */
 public static function getSupportStats()
 {
     $user = wp_get_current_user();
     $plugins = array();
     if (function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_and_valid_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $plugins[] = $plugin;
         }
     }
     $network_plugins = array();
     if (is_multisite() && function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_network_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $network_plugins[] = $plugin;
         }
     }
     $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;
         }
     }
     $keys = apply_filters('tribe-pue-install-keys', array());
     $systeminfo = array('url' => 'http://' . $_SERVER["HTTP_HOST"], 'name' => $user->display_name, 'email' => $user->user_email, 'install keys' => $keys, 'WordPress version' => get_bloginfo('version'), 'PHP version' => phpversion(), 'plugins' => $plugins, 'network plugins' => $network_plugins, 'mu plugins' => $mu_plugins, 'theme' => wp_get_theme()->get('Name'), 'multisite' => is_multisite(), 'settings' => TribeEvents::getOptions());
     $systeminfo = apply_filters('tribe-events-pro-support', $systeminfo);
     return $systeminfo;
 }
开发者ID:Vinnica,项目名称:theboxerboston.com,代码行数:67,代码来源:tribe-support.class.php


示例15: getSupportStats

 /**
  * Collect system information for support
  *
  * @return array of system data for support
  */
 public function getSupportStats()
 {
     $user = wp_get_current_user();
     $plugins = array();
     if (function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_and_valid_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $plugins[] = $plugin;
         }
     }
     $network_plugins = array();
     if (is_multisite() && function_exists('get_plugin_data')) {
         $plugins_raw = wp_get_active_network_plugins();
         foreach ($plugins_raw as $k => $v) {
             $plugin_details = get_plugin_data($v);
             $plugin = $plugin_details['Name'];
             if (!empty($plugin_details['Version'])) {
                 $plugin .= sprintf(' version %s', $plugin_details['Version']);
             }
             if (!empty($plugin_details['Author'])) {
                 $plugin .= sprintf(' by %s', $plugin_details['Author']);
             }
             if (!empty($plugin_details['AuthorURI'])) {
                 $plugin .= sprintf('(%s)', $plugin_details['AuthorURI']);
             }
             $network_plugins[] = $plugin;
         }
     }
     $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;
         }
     }
     $keys = apply_filters('tribe-pue-install-keys', array());
     $systeminfo = array('url' => 'http://' . $_SERVER['HTTP_HOST'], 'name' => $user->display_name, 'email' => $user->user_email, 'install keys' => $keys, 'WordPress version' => get_bloginfo('version'), 'PHP version' => phpversion(), 'plugins' => $plugins, 'network plugins' => $network_plugins, 'mu plugins' => $mu_plugins, 'theme' => wp_get_theme()->get('Name'), 'multisite' => is_multisite(), 'settings' => Tribe__Events__Main::getOptions(), 'WordPress timezone' => get_option('timezone_string', __('Unknown or not set', 'the-events-calendar')), 'server timezone' => date_default_timezone_get());
     if ($this->rewrite_rules_purged) {
         $systeminfo['rewrite rules purged'] = __('Rewrite rules were purged on load of this help page. Chances are there is a rewrite rule flush occurring in a plugin or theme!', 'the-events-calendar');
     }
     $systeminfo = apply_filters('tribe-events-pro-support', $systeminfo);
     return $systeminfo;
 }
开发者ID:hubbardsc,项目名称:field_day,代码行数:69,代码来源:Support.php


示例16: qtranxf_search_config_files

/**
 * @since 3.4
 */
function qtranxf_search_config_files()
{
    $found = qtranxf_search_config_files_theme();
    $plugins = wp_get_active_and_valid_plugins();
    $plugin_dir = WP_PLUGIN_DIR . '/' . qtranxf_plugin_dirname();
    //qtranxf_dbg_log('qtranxf_search_config_files: $plugin_dir: ', $plugin_dir);
    foreach ($plugins as $plugin) {
        $dir = dirname($plugin);
        $bnm = basename($dir);
        //qtranxf_dbg_log('$dir='.$dir.'; $bnm: ',$bnm);
        if (strpos($bnm, 'qtranslate-x') === 0) {
            continue;
        }
        if ($bnm == basename(QTRANSLATE_DIR)) {
            continue;
        }
        $fn = $dir . '/i18n-config.json';
        if (!file_exists($fn)) {
            $fn = $plugin_dir . '/i18n-config/plugins/' . $bnm . '/i18n-config.json';
            if (!file_exists($fn)) {
                continue;
            }
        }
        $found[] = $fn;
    }
    return qtranxf_normalize_config_files($found);
}
开发者ID:Alesja,项目名称:qtranslate-x,代码行数:30,代码来源:qtx_activation_hook.php


示例17: qtranxf_find_plugin_config_files

function qtranxf_find_plugin_config_files(&$fn_bnm, &$fn_qtx, $bnm)
{
    $plugins = wp_get_active_and_valid_plugins();
    $fn_bnm = null;
    if (!qtranxf_find_plugin_by_foder($bnm . '-qtranslate-x', $plugins)) {
        $fn_bnm = qtranxf_find_plugin_file($bnm . '/i18n-config.json');
        while (!$fn_bnm) {
            $fn_bnm = qtranxf_plugin_dirname() . '/i18n-config/plugins/' . $bnm . '/i18n-config.json';
            $fn_bnm = qtranxf_find_plugin_file($fn_bnm);
            if ($fn_bnm) {
                break;
            }
            $fn_bnm = qtranxf_plugin_dirname() . '/i18n-config/themes/' . $bnm . '/i18n-config.json';
            $fn_bnm = qtranxf_find_plugin_file($fn_bnm);
            break;
        }
    }
    $fn_qtx = null;
    while (qtranxf_endsWith($bnm, '-qtranslate-x')) {
        $bnm_qtx = substr($bnm, 0, -13);
        $plugins = wp_get_active_and_valid_plugins();
        $fn_qtx = qtranxf_plugin_dirname() . '/i18n-config/plugins/' . $bnm_qtx . '/i18n-config.json';
        $fn_qtx = qtranxf_find_plugin_file($fn_qtx);
        if ($fn_qtx) {
            break;
        }
        $fn_qtx = qtranxf_plugin_dirname() . '/i18n-config/themes/' . $bnm_qtx . '/i18n-config.json';
        $fn_qtx = qtranxf_find_plugin_file($fn_qtx);
        break;
    }
    return $fn_bnm || $fn_qtx;
}
开发者ID:danmilon,项目名称:donation-box,代码行数:32,代码来源:qtx_activation_hook.php


示例18: active_plugin_data

 public function active_plugin_data()
 {
     $active_plugins = wp_get_active_and_valid_plugins();
     $output_data = array('Name', 'Version', 'Author', 'PluginURI', 'Description');
     if (!empty($active_plugins)) {
         foreach ($active_plugins as $plugin_file) {
             $plugin_data = get_plugin_data($plugin_file, true, false);
             echo '<i> - File:</i> ' . $plugin_file . '<br />';
             if (!empty($plugin_data)) {
                 foreach ($output_data as $data_value) {
                     if ($plugin_data[$data_value]) {
                         echo '   - <strong>' . $data_value . ':</strong> ' . $plugin_data[$data_value] . '<br />';
                     }
                 }
             }
             echo '-- <br />';
         }
     }
 }
开发者ID:durichitayat,项目名称:befolio-wp,代码行数:19,代码来源:smyles-bug-report.php


示例19: bp_is_installed

 /**
  * Determines whether or not BuddyPress is installed.
  *
  * @package s2Member\Utilities
  * @since 110720
  *
  * @param bool $query_active_plugins Optional. If true, this conditional will query active plugins too.
  *    Defaults to true if {@link s2Member\WS_PLUGIN__S2MEMBER_ONLY} is true, else false.
  *
  * @return bool True if BuddyPress is installed, else false.
  */
 public static function bp_is_installed($query_active_plugins = NULL)
 {
     if (defined('BP_VERSION') && did_action('bp_core_loaded')) {
         return TRUE;
     }
     // Quickest/easiest way to determine.
     $s2o = defined('WS_PLUGIN__S2MEMBER_ONLY') && WS_PLUGIN__S2MEMBER_ONLY ? TRUE : FALSE;
     if ($query_active_plugins = !isset($query_active_plugins) && $s2o ? TRUE : $query_active_plugins) {
         $buddypress = 'buddypress/bp-loader.php';
         // BuddyPress.
         $active_plugins = is_multisite() ? wp_get_active_network_plugins() : array();
         $active_plugins = array_unique(array_merge($active_plugins, wp_get_active_and_valid_plugins()));
         foreach ($active_plugins as $active_plugin) {
             // Search.
             if (plugin_basename($active_plugin) === $buddypress) {
                 return TRUE;
             }
         }
         // BuddyPress active.
     }
     return FALSE;
     // Default return false.
 }
开发者ID:codeforest,项目名称:s2member,代码行数:34,代码来源:utils-conds.inc.php


示例20: get_current_plugins

 /**
  * Returns a formatted HTML list of all active plugins
  *
  * @return string
  */
 private function get_current_plugins()
 {
     $updates_avail = get_site_transient('update_plugins');
     $msg = '';
     foreach (wp_get_active_and_valid_plugins() as $plugin) {
         $plugin_data = get_plugin_data($plugin);
         $plugin_file = str_replace(trailingslashit(WP_PLUGIN_DIR), '', $plugin);
         if (isset($updates_avail->response[$plugin_file])) {
             $msg .= '<i class="icon-close1"></i> ';
         }
         $msg .= '<a href="' . $plugin_data['PluginURI'] . '">' . $plugin_data['Name'] . '</a> v' . $plugin_data['Version'] . '<br/>';
     }
     return $msg;
 }
开发者ID:yoast,项目名称:wp-helpscout,代码行数:19,代码来源:class-helpscout-beacon-identifier.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_get_active_network_plugins函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_generate_tag_cloud函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap