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

PHP is_network_admin函数代码示例

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

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



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

示例1: run

 function run()
 {
     add_action('w3tc_dashboard_setup', array(&$this, 'wp_dashboard_setup'));
     add_action('w3tc_network_dashboard_setup', array(&$this, 'wp_dashboard_setup'));
     // Configure authorize and have_zone
     $this->_setup($this->_config);
     /**
      * Retry setup with main blog
      */
     if (w3_is_network() && is_network_admin() && !$this->authorized) {
         $this->_config = new W3_Config(false, 1);
         $this->_setup($this->_config);
     }
     if (w3_is_network()) {
         $conig_admin = w3_instance('W3_ConfigAdmin');
         $this->_sealed = $conig_admin->get_boolean('cdn.configuration_sealed');
     }
     if ($this->have_zone && $this->authorized && isset($_GET['page']) && strpos($_GET['page'], 'w3tc_dashboard') !== false) {
         w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNA.php');
         w3_require_once(W3TC_LIB_NETDNA_DIR . '/NetDNAPresentation.php');
         $authorization_key = $this->_config->get_string('cdn.maxcdn.authorization_key');
         $alias = $consumerkey = $consumersecret = '';
         $keys = explode('+', $authorization_key);
         if (sizeof($keys) == 3) {
             list($alias, $consumerkey, $consumersecret) = $keys;
         }
         $this->api = new NetDNA($alias, $consumerkey, $consumersecret);
         add_action('admin_head', array(&$this, 'admin_head'));
     }
 }
开发者ID:rongandat,项目名称:sallumeh,代码行数:30,代码来源:MaxCDN.php


示例2: flush

 /**
  * Flush varnish cache
  */
 function flush()
 {
     if (!is_network_admin()) {
         $this->_purge(w3_get_home_url() . '/.*');
     } else {
         global $wpdb;
         $protocall = w3_is_https() ? 'https://' : 'http://';
         // If WPMU Domain Mapping plugin is installed and active
         if (defined('SUNRISE_LOADED') && SUNRISE_LOADED && isset($wpdb->dmtable) && !empty($wpdb->dmtable)) {
             $blogs = $wpdb->get_results("SELECT {$wpdb->blogs}.domain, {$wpdb->blogs}.path, {$wpdb->dmtable}.domain AS mapped_domain\n                                    FROM {$wpdb->dmtable}\n                                    RIGHT JOIN {$wpdb->blogs} ON {$wpdb->dmtable}.blog_id = {$wpdb->blogs}.blog_id\n                                    WHERE site_id = {$wpdb->siteid}\n                                    AND spam = 0\n                                    AND deleted = 0\n                                    AND archived = '0'\n                                   ");
             foreach ($blogs as $blog) {
                 if (!isset($blog->mapped_domain)) {
                     $url = $protocall . $blog->domain . (strlen($blog->path) > 1 ? '/' . trim($blog->path, '/') : '') . '/.*';
                 } else {
                     $url = $protocall . $blog->mapped_domain . '/.*';
                 }
                 $this->_purge($url);
             }
         } else {
             if (!w3_is_subdomain_install()) {
                 $this->_purge(w3_get_home_url() . '/.*');
             } else {
                 $blogs = $wpdb->get_results("\n                                        SELECT domain, path\n                                        FROM {$wpdb->blogs}\n                                        WHERE site_id = '{$wpdb->siteid}'\n                                        AND spam = 0\n                                        AND deleted = 0\n                                        AND archived = '0'\n                                    ");
                 foreach ($blogs as $blog) {
                     $url = $protocall . $blog->domain . (strlen($blog->path) > 1 ? '/' . trim($blog->path, '/') : '') . '/.*';
                     $this->_purge($url);
                 }
             }
         }
     }
 }
开发者ID:marqui678,项目名称:finalchance.Panopta,代码行数:34,代码来源:VarnishFlush.php


示例3: after

 function after()
 {
     if (empty($this->upgrader->result['destination_name'])) {
         return;
     }
     $theme_info = $this->upgrader->theme_info();
     if (empty($theme_info)) {
         return;
     }
     $name = $theme_info['Name'];
     $stylesheet = $this->upgrader->result['destination_name'];
     $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
     $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1, 'TB_iframe' => 'true'), trailingslashit(esc_url(get_option('home')))));
     $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
     $install_actions = array('preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>', 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $name)) . '">' . __('Activate') . '</a>');
     if (is_network_admin() && current_user_can('manage_network_themes')) {
         $install_actions['network_enable'] = '<a href="' . esc_url(wp_nonce_url('themes.php?action=enable&amp;theme=' . $template, 'enable-theme_' . $template)) . '" title="' . esc_attr__('Enable this theme for all sites in this network') . '" target="_parent">' . __('Network Enable') . '</a>';
     }
     $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('View Installed Themes', 'wp-app-store') . '</a>';
     if (!$this->result || is_wp_error($this->result) || is_network_admin()) {
         unset($install_actions['activate'], $install_actions['preview']);
     }
     $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
     if (!empty($install_actions)) {
         $this->feedback(implode(' | ', (array) $install_actions));
     }
 }
开发者ID:lcw07r,项目名称:productcampamsterdam.org,代码行数:27,代码来源:theme-upgrader-skin.php


示例4: log

 public function log($connector, $message, $args, $object_id, $contexts, $user_id = null)
 {
     global $wpdb;
     if (is_null($user_id)) {
         $user_id = get_current_user_id();
     }
     require_once MAINWP_WP_STREAM_INC_DIR . 'class-wp-stream-author.php';
     $user = new WP_User($user_id);
     $roles = get_option($wpdb->get_blog_prefix() . 'user_roles');
     if (!isset($args['author_meta'])) {
         $args['author_meta'] = array('user_email' => $user->user_email, 'display_name' => defined('WP_CLI') && empty($user->display_name) ? 'WP-CLI' : $user->display_name, 'user_login' => $user->user_login, 'user_role_label' => !empty($user->roles) ? $roles[$user->roles[0]]['name'] : null, 'agent' => MainWP_WP_Stream_Author::get_current_agent());
         if (defined('WP_CLI') && function_exists('posix_getuid')) {
             $uid = posix_getuid();
             $user_info = posix_getpwuid($uid);
             $args['author_meta']['system_user_id'] = $uid;
             $args['author_meta']['system_user_name'] = $user_info['name'];
         }
     }
     // Remove meta with null values from being logged
     $meta = array_filter($args, function ($var) {
         return !is_null($var);
     });
     $recordarr = array('object_id' => $object_id, 'site_id' => is_multisite() ? get_current_site()->id : 1, 'blog_id' => apply_filters('blog_id_logged', is_network_admin() ? 0 : get_current_blog_id()), 'author' => $user_id, 'author_role' => !empty($user->roles) ? $user->roles[0] : null, 'created' => current_time('mysql', 1), 'summary' => vsprintf($message, $args), 'parent' => self::$instance->prev_record, 'connector' => $connector, 'contexts' => $contexts, 'meta' => $meta, 'ip' => mainwp_wp_stream_filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP));
     $record_id = MainWP_WP_Stream_DB::get_instance()->insert($recordarr);
     return $record_id;
 }
开发者ID:HasClass0,项目名称:mainwp-child-reports,代码行数:26,代码来源:log.php


示例5: mgjp_mv_extra_activation_steps_page

/**
 * Adds an admin page to the plugins admin menu dropdown.
 * The page displays instructions to admins to fully activate
 * the Media Vault plugin
 *
 * @since 0.8.5
 */
function mgjp_mv_extra_activation_steps_page()
{
    if (is_multisite() && !is_network_admin()) {
        return;
    }
    add_submenu_page('plugins.php', __('Media Vault Activation Helper', 'media-vault'), __('Media Vault Activation', 'media-vault'), 'install_plugins', 'mgjp-mv-eas', 'mgjp_mv_render_extra_activation_steps_page');
}
开发者ID:TakenCdosG,项目名称:admissionsrevolution_new,代码行数:14,代码来源:mv-extra-activation-steps.php


示例6: __construct

 public function __construct()
 {
     /**
      * Check current WooCommerce version to ensure compatibility.
      */
     $woo_version = $this->wpbo_get_woo_version_number();
     if (version_compare($woo_version, '2.1', '<')) {
         exit(__('PayPal for WooCommerce requires WooCommerce version 2.1 or higher.  Please backup your site files and database, update WooCommerce, and try again.', 'paypal-for-woocommerce'));
     }
     add_filter('woocommerce_paypal_args', array($this, 'ae_paypal_standard_additional_parameters'));
     add_action('plugins_loaded', array($this, 'init'));
     register_activation_hook(__FILE__, array($this, 'activate_paypal_for_woocommerce'));
     register_deactivation_hook(__FILE__, array($this, 'deactivate_paypal_for_woocommerce'));
     add_action('wp_enqueue_scripts', array($this, 'woocommerce_paypal_express_init_styles'), 12);
     add_action('admin_notices', array($this, 'admin_notices'));
     add_action('admin_init', array($this, 'set_ignore_tag'));
     add_filter('woocommerce_product_title', array($this, 'woocommerce_product_title'));
     add_action('woocommerce_sections_checkout', array($this, 'donate_message'), 11);
     add_action('parse_request', array($this, 'woocommerce_paypal_express_review_order_page_angelleye'), 11);
     // http://stackoverflow.com/questions/22577727/problems-adding-action-links-to-wordpress-plugin
     $basename = plugin_basename(__FILE__);
     $prefix = is_network_admin() ? 'network_admin_' : '';
     add_filter("{$prefix}plugin_action_links_{$basename}", array($this, 'plugin_action_links'), 10, 4);
     add_action('woocommerce_after_add_to_cart_button', array($this, 'buy_now_button'));
     add_action('woocommerce_after_mini_cart', array($this, 'mini_cart_button'));
     add_action('woocommerce_add_to_cart_redirect', array($this, 'add_to_cart_redirect'));
     add_action('woocommerce_after_single_variation', array($this, 'buy_now_button_js'));
     add_action('admin_enqueue_scripts', array($this, 'onetarek_wpmut_admin_scripts'));
     add_action('admin_print_styles', array($this, 'onetarek_wpmut_admin_styles'));
     add_action('woocommerce_cart_calculate_fees', array($this, 'woocommerce_custom_surcharge'));
     add_action('woocommerce_before_add_to_cart_button', array($this, 'add_div_before_add_to_cart_button'), 25);
     add_action('woocommerce_after_add_to_cart_button', array($this, 'add_div_after_add_to_cart_button'), 35);
     add_action('admin_init', array($this, 'angelleye_check_version'), 5);
 }
开发者ID:Nat97,项目名称:paypal-woocommerce,代码行数:34,代码来源:paypal-for-woocommerce.php


示例7: admin_init

 public function admin_init()
 {
     if (!empty($_GET['developer_plugin_reset']) && current_user_can('manage_options')) {
         delete_option(self::OPTION);
     }
     $this->recommended_plugins = array('debug-bar' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar', 'a8c-developer'), 'active' => class_exists('Debug_Bar')), 'debug-bar-console' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Console', 'a8c-developer'), 'active' => function_exists('debug_bar_console_panel')), 'debug-bar-cron' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Cron', 'a8c-developer'), 'active' => function_exists('zt_add_debug_bar_cron_panel')), 'debug-bar-extender' => array('project_type' => 'all', 'name' => esc_html__('Debug Bar Extender', 'a8c-developer'), 'active' => class_exists('Debug_Bar_Extender')), 'rewrite-rules-inspector' => array('project_type' => 'all', 'name' => esc_html__('Rewrite Rules Inspector', 'a8c-developer'), 'active' => class_exists('Rewrite_Rules_Inspector')), 'log-deprecated-notices' => array('project_type' => 'all', 'name' => esc_html__('Log Deprecated Notices', 'a8c-developer'), 'active' => class_exists('Deprecated_Log')), 'log-viewer' => array('project_type' => 'all', 'name' => esc_html__('Log Viewer', 'a8c-developer'), 'active' => class_exists('ciLogViewer')), 'vip-scanner' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('VIP Scanner', 'a8c-developer'), 'active' => class_exists('VIP_Scanner')), 'jetpack' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Jetpack', 'a8c-developer'), 'active' => class_exists('Jetpack')), 'polldaddy' => array('project_type' => 'wpcom-vip', 'name' => esc_html__('Polldaddy Polls & Ratings', 'a8c-developer'), 'active' => class_exists('WP_Polldaddy')), 'monster-widget' => array('project_type' => 'all', 'name' => esc_html__('Monster Widget', 'a8c-developer'), 'active' => class_exists('Monster_Widget')), 'user-switching' => array('project_type' => 'all', 'name' => esc_html__('User Switching', 'a8c-developer'), 'active' => class_exists('user_switching')), 'piglatin' => array('project_type' => array('wporg-theme', 'wporg'), 'name' => esc_html__('Pig Latin', 'a8c-developer'), 'active' => class_exists('PigLatin')), 'rtl-tester' => array('project_type' => 'wporg-theme', 'name' => esc_html__('RTL Tester', 'a8c-developer'), 'active' => class_exists('RTLTester')), 'regenerate-thumbnails' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Regenerate Thumbnails', 'a8c-developer'), 'active' => class_exists('RegenerateThumbnails')), 'simply-show-ids' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Simply Show IDs', 'a8c-developer'), 'active' => function_exists('ssid_add')), 'theme-test-drive' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Theme Test Drive', 'a8c-developer'), 'active' => function_exists('TTD_filters'), 'filename' => 'themedrive.php'), 'theme-check' => array('project_type' => 'wporg-theme', 'name' => esc_html__('Theme Check', 'a8c-developer'), 'active' => function_exists('tc_add_headers')));
     if (!self::is_dev_version()) {
         $this->recommended_plugins['wordpress-beta-tester'] = array('project_type' => 'all', 'name' => esc_html__('Beta Tester', 'a8c-developer'), 'active' => class_exists('wp_beta_tester'), 'filename' => 'wp-beta-tester.php');
     }
     $this->recommended_constants = array('WP_DEBUG' => array('project_type' => 'all', 'description' => __('Enables <a href="http://codex.wordpress.org/Debugging_in_WordPress" target="_blank">debug mode</a> which helps identify and resolve issues', 'a8c-developer')), 'SAVEQUERIES' => array('project_type' => 'all', 'description' => esc_html__('Logs database queries to an array so you can review them. The Debug Bar plugin will list out database queries if you set this constant.', 'a8c-developer')), 'JETPACK_DEV_DEBUG' => array('project_type' => 'wpcom-vip', 'description' => __('Enables <a href="http://jetpack.me/2013/03/28/jetpack-dev-mode-release/">Development Mode</a> in Jetpack for testing features without a connection to WordPress.com.', 'a8c-developer')));
     register_setting(self::OPTION, self::OPTION, array($this, 'settings_validate'));
     wp_register_script('a8c-developer', plugins_url('developer.js', __FILE__), array('jquery'), self::VERSION);
     $strings = array('settings_slug' => self::PAGE_SLUG, 'go_to_step_2' => current_user_can('install_plugins') && current_user_can('activate_plugins') && 'direct' == get_filesystem_method() ? 'yes' : 'no', 'lightbox_title' => __('Developer: Plugin Setup', 'a8c-developer'), 'saving' => __('Saving...', 'a8c-developer'), 'installing' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Installing...', 'a8c-developer'), 'installed' => __('Installed', 'a8c-developer'), 'activating' => '<img src="images/loading.gif" alt="" /> ' . esc_html__('Activating...', 'a8c-developer'), 'activated' => __('Activated', 'a8c-developer'), 'error' => __('Error!', 'a8c-developer'), 'ACTIVE' => __('ACTIVE', 'a8c-developer'), 'INSTALLED' => __('INSTALLED', 'a8c-developer'), 'ERROR' => __('ERROR!', 'a8c-developer'));
     wp_localize_script('a8c-developer', 'a8c_developer_i18n', $strings);
     wp_register_style('a8c-developer', plugins_url('developer.css', __FILE__), array(), self::VERSION);
     // Handle the submission of the lightbox form if step 2 won't be shown
     if (!empty($_POST['action']) && 'a8c_developer_lightbox_step_1' == $_POST['action'] && !empty($_POST['a8c_developer_project_type']) && check_admin_referer('a8c_developer_lightbox_step_1')) {
         $this->save_project_type($_POST['a8c_developer_project_type']);
         add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
     }
     if (!get_option(self::OPTION)) {
         if (!empty($_GET['a8cdev_errorsaving'])) {
             add_settings_error(self::PAGE_SLUG, self::PAGE_SLUG . '_error_saving', __('Error saving settings. Please try again.', 'a8c-developer'));
         } elseif (!is_network_admin() && current_user_can('manage_options')) {
             add_action('admin_enqueue_scripts', array($this, 'load_lightbox_scripts_and_styles'));
             add_action('admin_footer', array($this, 'output_setup_box_html'));
         }
     }
 }
开发者ID:9pmStudios,项目名称:developer,代码行数:29,代码来源:developer.php


示例8: __construct

 /**
  * Constructor.
  * @param string $file The base file of the plugin.
  * @since  1.0.0
  * @return  void
  */
 public function __construct($file, $version)
 {
     // If multisite, plugin must be network activated. First make sure the is_plugin_active_for_network function exists
     if (is_multisite() && !is_network_admin()) {
         remove_action('admin_notices', 'woothemes_updater_notice');
         // remove admin notices for plugins outside of network admin
         if (!function_exists('is_plugin_active_for_network')) {
             require_once ABSPATH . '/wp-admin/includes/plugin.php';
         }
         if (!is_plugin_active_for_network(plugin_basename($file))) {
             add_action('admin_notices', array($this, 'admin_notice_require_network_activation'));
         }
         return;
     }
     $this->file = $file;
     $this->version = $version;
     $this->plugin_url = trailingslashit(plugins_url('', $plugin = $file));
     $this->plugin_path = trailingslashit(dirname($file));
     $this->products = array();
     $this->load_plugin_textdomain();
     // Run this on activation.
     register_activation_hook($this->file, array($this, 'activation'));
     if (is_admin()) {
         // Load the admin.
         require_once 'class-woothemes-updater-admin.php';
         $this->admin = new WooThemes_Updater_Admin($file);
         // Look for enabled updates across all themes (active or otherwise). If they are available, queue them.
         add_action('init', array($this, 'maybe_queue_theme_updates'), 1);
         // Get queued plugin updates - Run on init so themes are loaded as well as plugins.
         add_action('init', array($this, 'load_queued_updates'), 2);
     }
     $this->add_notice_unlicensed_product();
     add_filter('site_transient_' . 'update_plugins', array($this, 'change_update_information'));
 }
开发者ID:DustinHartzler,项目名称:TheCLEFT,代码行数:40,代码来源:class-woothemes-updater.php


示例9: register

 /**
  * Register the top-level 'Snippets' menu and associated 'Manage' subpage
  *
  * @uses add_menu_page() to register a top-level menu
  * @uses add_submenu_page() to register a sub-menu
  */
 function register()
 {
     /* Register the top-level menu */
     add_menu_page(__('Snippets', 'code-snippets'), __('Snippets', 'code-snippets'), code_snippets()->get_cap(), code_snippets()->get_menu_slug(), array($this, 'render'), 'div', is_network_admin() ? 21 : 67);
     /* Register the sub-menu */
     parent::register();
 }
开发者ID:shwetadubey,项目名称:upfit,代码行数:13,代码来源:class-manage-menu.php


示例10: _isInstantiatable

 protected function _isInstantiatable()
 {
     if (isset($GLOBALS['pagenow']) && 'admin-ajax.php' === $GLOBALS['pagenow']) {
         return false;
     }
     return !is_network_admin();
 }
开发者ID:sultann,项目名称:admin-page-framework,代码行数:7,代码来源:AdminPageFramework_Router.php


示例11: install

 /**
  * Install WPCM
  */
 public static function install()
 {
     if (!defined('WPCM_INSTALLING')) {
         define('WPCM_INSTALLING', true);
     }
     // Ensure needed classes are loaded
     include_once 'admin/class-wpcm-admin-notices.php';
     self::create_options();
     self::create_roles();
     // Register post types
     WPCM_Post_Types::register_post_types();
     WPCM_Post_Types::register_taxonomies();
     // Queue upgrades
     $current_version = get_option('wpclubmanager_version', null);
     if ($current_version) {
         update_option('wpcm_version_upgraded_from', $current_version);
     }
     // Update version
     delete_option('wpclubmanager_version');
     add_option('wpclubmanager_version', WPCM()->version);
     // Flush rules after install
     flush_rewrite_rules();
     // Redirect to welcome screen
     if (!is_network_admin() && !isset($_GET['activate-multi'])) {
         set_transient('_wpcm_activation_redirect', 1, 30);
     }
     // Trigger action
     do_action('wpclubmanager_installed');
 }
开发者ID:salageansergiumarco,项目名称:academiadefotbalnapoca.ro,代码行数:32,代码来源:class-wpcm-install.php


示例12: bws_show_demo_button

        /**
         * Display "Install demo data" or "Uninstal demo data" buttons
         * @return void
         */
        function bws_show_demo_button($form_title)
        {
            if (!(is_multisite() && is_network_admin())) {
                if (empty($this->bws_demo_options)) {
                    $value = 'install';
                    $button_title = __('Install Demo Data', $this->bws_plugin_text_domain);
                } else {
                    $value = 'remove';
                    $button_title = __('Remove Demo Data', $this->bws_plugin_text_domain);
                    $form_title = __('Delete demo-data and restore old plugin settings.', $this->bws_plugin_text_domain);
                }
                ?>
				<form method="post" action="" id="bws_handle_demo_data">
					<p><?php 
                echo $form_title;
                ?>
</p>
					<p>
						<button class="button" name="bws_handle_demo" value="<?php 
                echo $value;
                ?>
"><?php 
                echo $button_title;
                ?>
</button>
						<?php 
                wp_nonce_field($this->bws_plugin_basename, 'bws_settings_nonce_name');
                ?>
					</p>
				</form>
			<?php 
            }
        }
开发者ID:jenia-buianov,项目名称:all_my_sites,代码行数:37,代码来源:class-bws-demo-data.php


示例13: onDisplaySettingsPage

 public function onDisplaySettingsPage()
 {
     $this->check_wplister_setup('settings');
     $default_tab = is_network_admin() ? 'license' : 'settings';
     $active_tab = isset($_GET['tab']) ? $_GET['tab'] : $default_tab;
     if ('categories' == $active_tab) {
         return $this->displayCategoriesPage();
     }
     if ('developer' == $active_tab) {
         return $this->displayDeveloperPage();
     }
     if ('advanced' == $active_tab) {
         return $this->displayAdvancedSettingsPage();
     }
     if ('accounts' == $active_tab) {
         return $this->displayAccountsPage();
     }
     // // action FetchToken
     // if ( $this->requestAction() == 'FetchToken' ) {
     // 	// FetchToken
     // 	$this->initEC();
     // 	$ebay_token = $this->EC->doFetchToken();
     // 	$this->EC->closeEbay();
     // 	// check if we have a token
     // 	if ( self::getOption('ebay_token') == '' ) {
     // 		$this->showMessage( "There was a problem fetching your token. Make sure you follow the instructions.", 1 );
     // 	}
     // 	$this->check_wplister_setup('settings');
     // }
     $aData = array('plugin_url' => self::$PLUGIN_URL, 'message' => $this->message, 'ebay_sites' => EbayController::getEbaySites(), 'ebay_token_userid' => self::getOption('ebay_token_userid'), 'ebay_user' => self::getOption('ebay_user'), 'option_cron_auctions' => self::getOption('cron_auctions'), 'local_auction_display' => self::getOption('local_auction_display', 'off'), 'send_weight_and_size' => self::getOption('send_weight_and_size', 'default'), 'is_staging_site' => $this->isStagingSite(), 'settings_url' => 'admin.php?page=' . self::ParentMenuId . '-settings', 'auth_url' => 'admin.php?page=' . self::ParentMenuId . '-settings' . '&tab=' . $active_tab . '&action=wplRedirectToAuthURL', 'form_action' => 'admin.php?page=' . self::ParentMenuId . '-settings' . '&tab=' . $active_tab);
     $this->display('settings_page', $aData);
 }
开发者ID:booklein,项目名称:wpbookle,代码行数:32,代码来源:SettingsPage.php


示例14: __construct

 /**
  * Sets up properties.
  */
 public function __construct($sOptionKey)
 {
     $this->bIsNetworkAdmin = is_network_admin();
     // must be done first
     $this->sOptionKey = $sOptionKey;
     $this->aOptions = $this->_getFormattedOptions($sOptionKey);
 }
开发者ID:michaeluno,项目名称:admin-page-framework,代码行数:10,代码来源:AdminPageFrameworkLoader_Option.php


示例15: edd_install

/**
 * Install
 *
 * Runs on plugin install.
 *
 * @access      private
 * @since       1.0
 * @return      void
*/
function edd_install()
{
    global $wpdb, $edd_options;
    // Setup the Downloads Custom Post Type
    edd_setup_edd_post_types();
    // Setup the Download Taxonomies
    edd_setup_download_taxonomies();
    // Clear the permalinks
    flush_rewrite_rules();
    // Checks if the purchase page option exists
    if (!isset($edd_options['purchase_page'])) {
        // Checkout Page
        $checkout = wp_insert_post(array('post_title' => __('Checkout', 'edd'), 'post_content' => '[download_checkout]', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'comment_status' => 'closed'));
        // Purchase Confirmation (Success) Page
        $success = wp_insert_post(array('post_title' => __('Purchase Confirmation', 'edd'), 'post_content' => __('Thank you for your purchase!', 'edd'), 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'comment_status' => 'closed'));
        // Failed Purchase Page
        $failed = wp_insert_post(array('post_title' => __('Transaction Failed', 'edd'), 'post_content' => __('Your transaction failed, please try again or contact site support.', 'edd'), 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_parent' => $checkout, 'comment_status' => 'closed'));
        // Purchase History (History) Page
        $history = wp_insert_post(array('post_title' => __('Purchase History', 'edd'), 'post_content' => '[download_history]', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'page', 'post_parent' => $checkout, 'comment_status' => 'closed'));
    }
    // Bail if activating from network, or bulk
    if (is_network_admin() || isset($_GET['activate-multi'])) {
        return;
    }
    // Add the transient to redirect
    set_transient('_edd_activation_redirect', true, 30);
}
开发者ID:vheidari,项目名称:Easy-Digital-Downloads,代码行数:36,代码来源:install.php


示例16: wpstg_install

/**
 * Install
 *
 * Runs on plugin install to populates the settings fields for those plugin
 * pages. After successful install, the user is redirected to the WPSTG Welcome
 * screen.
 *
 * @since 0.9.0
 * @global $wpdb
 * @global $wpstg_options
 * @global $wp_version
 * @return void
 */
function wpstg_install()
{
    global $wpdb, $wpstg_options, $wp_version;
    // Add Upgraded from Option
    $current_version = get_option('wpstg_version');
    if ($current_version) {
        update_option('wpstg_version_upgraded_from', $current_version);
    }
    // Update the current version
    update_option('wpstg_version', WPSTG_VERSION);
    // Add plugin installation date and variable for rating div
    add_option('wpstg_installDate', date('Y-m-d h:i:s'));
    add_option('wpstg_RatingDiv', 'no');
    // Add First-time variables
    add_option('wpstg_firsttime', 'true');
    add_option('wpstg_is_staging_site', 'false');
    // Show beta notice
    add_option('wpstg_hide_beta', 'no');
    // Create empty config files in /wp-content/uploads/wp-staging
    wpstg_create_remaining_files();
    wpstg_create_clonedetails_files();
    /* Setup some default options
     * Store our initial social networks in separate option row.
     * For easier modification and to prevent some trouble
     */
    // Bail if activating from network, or bulk
    if (is_network_admin() || isset($_GET['activate-multi'])) {
        return;
    }
    // Add the transient to redirect / not for multisites
    set_transient('_wpstg_activation_redirect', true, 30);
}
开发者ID:pedro-mendonca,项目名称:wp-staging,代码行数:45,代码来源:install.php


示例17: maybe_init_upgrade

 /**
  * Maybe initialize the upgrade
  */
 function maybe_init_upgrade()
 {
     if (!is_admin() || defined('DOING_AJAX') && DOING_AJAX) {
         return;
     }
     // make sure this only fires inside the network admin for multisites
     if (is_multisite() && !is_network_admin()) {
         return;
     }
     // Have we completed the upgrade yet?
     if ($this->as3cf->get_setting('post_meta_version', 0) > 0) {
         return;
     }
     // If the upgrade status is already set, then we've already initialized the upgrade
     if ($this->get_upgrade_status()) {
         return;
     }
     // Do we actually have S3 meta data without regions to update?
     // No need to bother for fresh sites, or media not uploaded to S3
     if (0 == $this->count_all_attachments_without_region()) {
         $this->as3cf->set_setting('post_meta_version', 1);
         $this->as3cf->save_settings();
         return;
     }
     // Initialize the upgrade
     $this->save_session(array('status' => self::STATUS_RUNNING));
     $this->as3cf->schedule_event(self::CRON_HOOK, self::CRON_SCHEDULE_KEY);
 }
开发者ID:ryuqing,项目名称:cake,代码行数:31,代码来源:as3cf-upgrade.php


示例18: admin_bar_menu

 /**
  * Remove the WordPress comments menu bar item, replacing with a Facebook comments link
  * Check if Facebook comments enabled and if the current user might be able to view a comments edit screen on Facebook
  *
  * @since 1.1
  * @see WP_Admin_Bar->add_menus()
  */
 public static function admin_bar_menu()
 {
     global $facebook_loader;
     if (is_network_admin() && is_user_admin()) {
         return;
     }
     // use moderate_comments capability as a local proxy for accounts that might be granted moderate comments permissions for the Facebook application if the application administrator fully setup the app
     // technically the WordPress menu item is added for users with 'edit_posts' due to the permissions of the destination page but we'll check for the specific comments permission instead
     // TODO: check if Facebook data stored for current user, check if Facebook user is moderator
     if (!current_user_can('moderate_comments')) {
         return;
     }
     if (!class_exists('Facebook_User')) {
         require_once dirname(dirname(__FILE__)) . '/facebook-user.php';
     }
     $current_user = wp_get_current_user();
     $facebook_user_data = Facebook_User::get_user_meta($current_user->ID, 'fb_data', true);
     if (!(is_array($facebook_user_data) && isset($facebook_user_data['fb_uid']))) {
         return;
     }
     // swap only. don't add a menu item if none existed
     if (remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60)) {
         add_action('admin_bar_menu', array('Facebook_Comments', 'admin_bar_add_comments_menu'), 60);
     }
 }
开发者ID:batruji,项目名称:metareading,代码行数:32,代码来源:class-facebook-comments.php


示例19: site_option_allowedthemes

 function site_option_allowedthemes($themes)
 {
     global $psts;
     if (is_network_admin()) {
         return $themes;
     }
     $blog_id = get_current_blog_id();
     // If the blog is not a Pro Site, just return standard themes
     $visible_pro_only = apply_filters('prosites_show_themes_prosites_only', false, is_pro_site(get_current_blog_id()));
     if ($visible_pro_only || defined('PSTS_THEMES_PRO_ONLY') && PSTS_THEMES_PRO_ONLY === true) {
         update_blog_option($blog_id, 'psts_blog_allowed_themes', $themes);
         return $themes;
     }
     $allowed_themes = $psts->get_setting('pt_allowed_themes');
     if ($allowed_themes == false) {
         $allowed_themes = array();
     }
     if (count($allowed_themes) > 0) {
         if (!is_array($themes)) {
             $themes = array();
         }
         foreach ($allowed_themes as $key => $allowed_theme) {
             $themes[$key] = $allowed_theme;
         }
     }
     update_blog_option($blog_id, 'psts_blog_allowed_themes', $themes);
     return $themes;
 }
开发者ID:vilmark,项目名称:vilmark_main,代码行数:28,代码来源:premium-themes.php


示例20: __construct

 /**
  * Public constructor
  */
 public function __construct()
 {
     // Get all sections from the database
     self::$sections = WP_Stream_Reports_Settings::get_user_options('sections');
     // Load records
     add_filter('wp_stream_reports_load_records', array($this, 'sort_coordinates_by_count'), 10, 2);
     add_filter('wp_stream_reports_load_records', array($this, 'limit_coordinates'), 10, 2);
     // Make charts
     add_filter('wp_stream_reports_make_chart', array($this, 'pie_chart_coordinates'), 10, 2);
     add_filter('wp_stream_reports_make_chart', array($this, 'bar_chart_coordinates'), 10, 2);
     add_filter('wp_stream_reports_make_chart', array($this, 'line_chart_coordinates'), 10, 2);
     // Finalize charts
     add_filter('wp_stream_reports_finalize_chart', array($this, 'translate_labels'), 10, 2);
     add_filter('wp_stream_reports_finalize_chart', array($this, 'apply_chart_settings'), 10, 2);
     // Get chart labels
     add_filter('wp_stream_reports_get_label', array($this, 'translate_data_type_labels'), 10, 2);
     // Specific data for multisite
     if (is_multisite() && is_network_admin()) {
         add_filter('wp_stream_reports_data_types', array($this, 'mutlisite_data_types'), 10);
         add_filter('wp_stream_reports_selector_types', array($this, 'mutlisite_selector_types'), 10);
         add_filter('wp_stream_reports_get_label', array($this, 'multisite_labels'), 10, 2);
         add_filter('wp_stream_reports_query_args', array($this, 'multisite_query_args'), 10, 2);
     }
     $ajax_hooks = array('wp_stream_reports_add_metabox' => 'add_metabox', 'wp_stream_reports_delete_metabox' => 'delete_metabox', 'wp_stream_reports_default_reports' => 'setup_user', 'wp_stream_reports_save_metabox_config' => 'save_metabox_config', 'wp_stream_reports_save_chart_height' => 'save_chart_height', 'wp_stream_reports_save_chart_options' => 'save_chart_options', 'wp_stream_reports_update_metabox_display' => 'update_metabox_display');
     // Register all ajax action and check referer for this class
     WP_Stream_Reports::handle_ajax_request($ajax_hooks, $this);
 }
开发者ID:xwp,项目名称:stream-legacy,代码行数:30,代码来源:meta-boxes.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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