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

PHP get_network_option函数代码示例

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

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



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

示例1: get_dashboard_blog

/**
 * Get the "dashboard blog", the blog where users without a blog edit their profile data.
 * Dashboard blog functionality was removed in WordPress 3.1, replaced by the user admin.
 *
 * @since MU
 * @deprecated 3.1.0 Use get_blog_details()
 * @see get_blog_details()
 *
 * @return int Current site ID.
 */
function get_dashboard_blog()
{
    _deprecated_function(__FUNCTION__, '3.1');
    if ($blog = get_network_option('dashboard_blog')) {
        return get_blog_details($blog);
    }
    return get_blog_details($GLOBALS['current_site']->blog_id);
}
开发者ID:riasnelli,项目名称:WordPress,代码行数:18,代码来源:ms-deprecated.php


示例2: deactivate_plugins

 /**
  * Deactivates the given plugins network-wide.
  *
  * @since 3.0.0
  *
  * @param string[] $plugins Plugin base names (or partials). These will be matched against all active plugins.
  *
  * @return string[] An array with all plugins that were deactivated.
  */
 public function deactivate_plugins(array $plugins)
 {
     $active_plugins = (array) get_network_option(null, NetworkPluginDeactivator::OPTION, []);
     $plugins_to_deactivate = $this->get_plugins_to_deactivate(array_keys($active_plugins), $plugins);
     if (!$plugins_to_deactivate) {
         return $plugins_to_deactivate;
     }
     $active_plugins = array_diff_key($active_plugins, array_flip($plugins_to_deactivate));
     update_site_option(NetworkPluginDeactivator::OPTION, $active_plugins);
     return $plugins_to_deactivate;
 }
开发者ID:inpsyde,项目名称:multilingual-press,代码行数:20,代码来源:MatchingNetworkPluginDeactivator.php


示例3: get_locale

/**
 * Retrieves the current locale.
 *
 * If the locale is set, then it will filter the locale in the {@see 'locale'}
 * filter hook and return the value.
 *
 * If the locale is not set already, then the WPLANG constant is used if it is
 * defined. Then it is filtered through the {@see 'locale'} filter hook and
 * the value for the locale global set and the locale is returned.
 *
 * The process to get the locale should only be done once, but the locale will
 * always be filtered using the {@see 'locale'} hook.
 *
 * @since 1.5.0
 *
 * @global string $locale
 * @global string $wp_local_package
 *
 * @return string The locale of the blog or from the {@see 'locale'} hook.
 */
function get_locale()
{
    global $locale, $wp_local_package;
    if (isset($locale)) {
        /**
         * Filter WordPress install's locale ID.
         *
         * @since 1.5.0
         *
         * @param string $locale The locale ID.
         */
        return apply_filters('locale', $locale);
    }
    if (isset($wp_local_package)) {
        $locale = $wp_local_package;
    }
    // WPLANG was defined in wp-config.
    if (defined('WPLANG')) {
        $locale = WPLANG;
    }
    // If multisite, check options.
    if (is_multisite()) {
        // Don't check blog option when installing.
        if (defined('WP_INSTALLING') || false === ($ms_locale = get_option('WPLANG'))) {
            $ms_locale = get_network_option('WPLANG');
        }
        if ($ms_locale !== false) {
            $locale = $ms_locale;
        }
    } else {
        $db_locale = get_option('WPLANG');
        if ($db_locale !== false) {
            $locale = $db_locale;
        }
    }
    if (empty($locale)) {
        $locale = 'en_US';
    }
    /** This filter is documented in wp-includes/l10n.php */
    return apply_filters('locale', $locale);
}
开发者ID:9time,项目名称:WordPress,代码行数:61,代码来源:l10n.php


示例4: ms_upload_constants

/**
 * Defines Multisite upload constants.
 *
 * Exists for backward compatibility with legacy file-serving through
 * wp-includes/ms-files.php (wp-content/blogs.php in MU).
 *
 * @since 3.0.0
 *
 * @global wpdb $wpdb
 */
function ms_upload_constants()
{
    global $wpdb;
    // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT.
    add_filter('default_site_option_ms_files_rewriting', '__return_true');
    if (!get_network_option('ms_files_rewriting')) {
        return;
    }
    // Base uploads dir relative to ABSPATH
    if (!defined('UPLOADBLOGSDIR')) {
        define('UPLOADBLOGSDIR', 'wp-content/blogs.dir');
    }
    // Note, the main site in a post-MU network uses wp-content/uploads.
    // This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
    if (!defined('UPLOADS')) {
        define('UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/");
        // Uploads dir relative to ABSPATH
        if ('wp-content/blogs.dir' == UPLOADBLOGSDIR && !defined('BLOGUPLOADDIR')) {
            define('BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/");
        }
    }
}
开发者ID:riasnelli,项目名称:WordPress,代码行数:32,代码来源:ms-default-constants.php


示例5: __invoke

 /**
  * Get/set sys version.
  *
  * @since 160531 Sys options.
  *
  * @param string     $key      Sys option key.
  * @param mixed|null $value    If setting value.
  * @param bool       $autoload Autoload option key?
  *
  * @return mixed|null Sys option value or `null`.
  */
 public function __invoke(string $key, $value = null, bool $autoload = true)
 {
     $key = $this->App->Config->©brand['©var'] . '_' . $key;
     if ($this->App->Config->§specs['§is_network_wide'] && $this->Wp->is_multisite) {
         if (isset($value)) {
             update_network_option(null, $key, $value);
         }
         if (($value = get_network_option(null, $key)) === null || $value === false) {
             add_network_option(null, $key, ':null');
             // Autoload impossible.
             // These will not autoload and there is no way to change this.
         }
     } else {
         // Default.
         if (isset($value)) {
             update_option($key, $value);
         }
         if (($value = get_option($key)) === null || $value === false) {
             add_option($key, ':null', '', $autoload ? 'yes' : 'no');
         }
     }
     return $value === null || $value === false || $value === ':null' ? null : $value;
 }
开发者ID:websharks,项目名称:wp-sharks-core,代码行数:34,代码来源:SysOption.php


示例6: wp_die

if (!is_multisite()) {
    wp_die(__('Multisite support is not enabled.'));
}
if (!current_user_can('manage_network_themes')) {
    wp_die(__('You do not have sufficient permissions to manage network themes.'));
}
$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
$pagenum = $wp_list_table->get_pagenum();
$action = $wp_list_table->current_action();
$s = isset($_REQUEST['s']) ? $_REQUEST['s'] : '';
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
$temp_args = array('enabled', 'disabled', 'deleted', 'error');
$_SERVER['REQUEST_URI'] = remove_query_arg($temp_args, $_SERVER['REQUEST_URI']);
$referer = remove_query_arg($temp_args, wp_get_referer());
if ($action) {
    $allowed_themes = get_network_option('allowedthemes');
    switch ($action) {
        case 'enable':
            check_admin_referer('enable-theme_' . $_GET['theme']);
            $allowed_themes[$_GET['theme']] = true;
            update_network_option('allowedthemes', $allowed_themes);
            if (false === strpos($referer, '/network/themes.php')) {
                wp_redirect(network_admin_url('themes.php?enabled=1'));
            } else {
                wp_safe_redirect(add_query_arg('enabled', 1, $referer));
            }
            exit;
        case 'disable':
            check_admin_referer('disable-theme_' . $_GET['theme']);
            unset($allowed_themes[$_GET['theme']]);
            update_network_option('allowedthemes', $allowed_themes);
开发者ID:riasnelli,项目名称:WordPress,代码行数:31,代码来源:themes.php


示例7: set_site_transient

/**
 * Set/update the value of a site transient.
 *
 * You do not need to serialize values, if the value needs to be serialize, then
 * it will be serialized before it is set.
 *
 * @since 2.9.0
 *
 * @see set_transient()
 *
 * @param string $transient  Transient name. Expected to not be SQL-escaped. Must be
 *                           40 characters or fewer in length.
 * @param mixed  $value      Transient value. Expected to not be SQL-escaped.
 * @param int    $expiration Optional. Time until expiration in seconds. Default 0.
 * @return bool False if value was not set and true if value was set.
 */
function set_site_transient($transient, $value, $expiration = 0)
{
    /**
     * Filter the value of a specific site transient before it is set.
     *
     * The dynamic portion of the hook name, `$transient`, refers to the transient name.
     *
     * @since 3.0.0
     * @since 4.4.0 The `$transient` parameter was added
     *
     * @param mixed  $value     Value of site transient.
     * @param string $transient Transient name.
     */
    $value = apply_filters('pre_set_site_transient_' . $transient, $value, $transient);
    $expiration = (int) $expiration;
    if (wp_using_ext_object_cache()) {
        $result = wp_cache_set($transient, $value, 'site-transient', $expiration);
    } else {
        $transient_timeout = '_site_transient_timeout_' . $transient;
        $option = '_site_transient_' . $transient;
        if (false === get_network_option($option)) {
            if ($expiration) {
                add_network_option($transient_timeout, time() + $expiration);
            }
            $result = add_network_option($option, $value);
        } else {
            if ($expiration) {
                update_network_option($transient_timeout, time() + $expiration);
            }
            $result = update_network_option($option, $value);
        }
    }
    if ($result) {
        /**
         * Fires after the value for a specific site transient has been set.
         *
         * The dynamic portion of the hook name, `$transient`, refers to the transient name.
         *
         * @since 3.0.0
         * @since 4.4.0 The `$transient` parameter was added
         *
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds. Default 0.
         * @param string $transient  Transient name.
         */
        do_action('set_site_transient_' . $transient, $value, $expiration, $transient);
        /**
         * Fires after the value for a site transient has been set.
         *
         * @since 3.0.0
         *
         * @param string $transient  The name of the site transient.
         * @param mixed  $value      Site transient value.
         * @param int    $expiration Time until expiration in seconds. Default 0.
         */
        do_action('setted_site_transient', $transient, $value, $expiration);
    }
    return $result;
}
开发者ID:9time,项目名称:WordPress,代码行数:75,代码来源:option.php


示例8: test_get_network_option_network_id_parameter

 /**
  * @dataProvider data_network_id_parameter
  *
  * @param $network_id
  * @param $expected_response
  */
 function test_get_network_option_network_id_parameter($network_id, $expected_response)
 {
     $option = rand_str();
     $this->assertEquals($expected_response, get_network_option($network_id, $option, true));
 }
开发者ID:nkeat12,项目名称:dv,代码行数:11,代码来源:networkOption.php


示例9: get_available_languages

			<td><input name="blog[title]" type="text" class="regular-text" id="site-title" /></td>
		</tr>
		<?php 
$languages = get_available_languages();
$translations = wp_get_available_translations();
if (!empty($languages) || !empty($translations)) {
    ?>
			<tr class="form-field form-required">
				<th scope="row"><label for="site-language"><?php 
    _e('Site Language');
    ?>
</label></th>
				<td>
					<?php 
    // Network default.
    $lang = get_network_option('WPLANG');
    // Use English if the default isn't available.
    if (!in_array($lang, $languages)) {
        $lang = '';
    }
    wp_dropdown_languages(array('name' => 'WPLANG', 'id' => 'site-language', 'selected' => $lang, 'languages' => $languages, 'translations' => $translations, 'show_available_translations' => wp_can_install_language_pack()));
    ?>
				</td>
			</tr>
		<?php 
}
// Languages.
?>
		<tr class="form-field form-required">
			<th scope="row"><label for="admin-email"><?php 
_e('Admin Email');
开发者ID:riasnelli,项目名称:WordPress,代码行数:31,代码来源:site-new.php


示例10: script_concat_settings

/**
 * Determine the concatenation and compression settings for scripts and styles.
 *
 * @since 2.8.0
 *
 * @global bool $concatenate_scripts
 * @global bool $compress_scripts
 * @global bool $compress_css
 */
function script_concat_settings()
{
    global $concatenate_scripts, $compress_scripts, $compress_css;
    $compressed_output = ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler');
    if (!isset($concatenate_scripts)) {
        $concatenate_scripts = defined('CONCATENATE_SCRIPTS') ? CONCATENATE_SCRIPTS : true;
        if (!is_admin() || defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
            $concatenate_scripts = false;
        }
    }
    if (!isset($compress_scripts)) {
        $compress_scripts = defined('COMPRESS_SCRIPTS') ? COMPRESS_SCRIPTS : true;
        if ($compress_scripts && (!get_network_option('can_compress_scripts') || $compressed_output)) {
            $compress_scripts = false;
        }
    }
    if (!isset($compress_css)) {
        $compress_css = defined('COMPRESS_CSS') ? COMPRESS_CSS : true;
        if ($compress_css && (!get_network_option('can_compress_scripts') || $compressed_output)) {
            $compress_css = false;
        }
    }
}
开发者ID:9time,项目名称:WordPress,代码行数:32,代码来源:script-loader.php


示例11: get_super_admins

/**
 * Retrieve a list of super admins.
 *
 * @since 3.0.0
 *
 * @global array $super_admins
 *
 * @return array List of super admin logins
 */
function get_super_admins()
{
    global $super_admins;
    if (isset($super_admins)) {
        return $super_admins;
    } else {
        return get_network_option('site_admins', array('admin'));
    }
}
开发者ID:riasnelli,项目名称:WordPress,代码行数:18,代码来源:capabilities-functions.php


示例12: network_step2


//.........这里部分代码省略.........
            printf(__('These unique authentication keys are also missing from your %s file.'), '<code>wp-config.php</code>');
        }
        ?>
		<?php 
        _e('To make your installation more secure, you should also add:');
        ?>
	</p>
	<textarea class="code" readonly="readonly" cols="100" rows="<?php 
        echo $num_keys_salts;
        ?>
"><?php 
        echo esc_textarea($keys_salts_str);
        ?>
</textarea>
<?php 
    }
    ?>
</li>
<?php 
    if (iis7_supports_permalinks()) {
        // IIS doesn't support RewriteBase, all your RewriteBase are belong to us
        $iis_subdir_match = ltrim($base, '/') . $subdir_match;
        $iis_rewrite_base = ltrim($base, '/') . $rewrite_base;
        $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';
        $web_config_file = '<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="WordPress Rule 1" stopProcessing="true">
                    <match url="^index\\.php$" ignoreCase="false" />
                    <action type="None" />
                </rule>';
        if (is_multisite() && get_network_option('ms_files_rewriting')) {
            $web_config_file .= '
                <rule name="WordPress Rule for Files" stopProcessing="true">
                    <match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" />
                    <action type="Rewrite" url="' . $iis_rewrite_base . WPINC . '/ms-files.php?file={R:1}" appendQueryString="false" />
                </rule>';
        }
        $web_config_file .= '
                <rule name="WordPress Rule 2" stopProcessing="true">
                    <match url="^' . $iis_subdir_match . 'wp-admin$" ignoreCase="false" />
                    <action type="Redirect" url="' . $iis_subdir_replacement . 'wp-admin/" redirectType="Permanent" />
                </rule>
                <rule name="WordPress Rule 3" stopProcessing="true">
                    <match url="^" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAny">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="WordPress Rule 4" stopProcessing="true">
                    <match url="^' . $iis_subdir_match . '(wp-(content|admin|includes).*)" ignoreCase="false" />
                    <action type="Rewrite" url="' . $iis_rewrite_base . '{R:1}" />
                </rule>
                <rule name="WordPress Rule 5" stopProcessing="true">
                    <match url="^' . $iis_subdir_match . '([_0-9a-zA-Z-]+/)?(.*\\.php)$" ignoreCase="false" />
                    <action type="Rewrite" url="' . $iis_rewrite_base . '{R:2}" />
                </rule>
                <rule name="WordPress Rule 6" stopProcessing="true">
                    <match url="." ignoreCase="false" />
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
开发者ID:riasnelli,项目名称:WordPress,代码行数:67,代码来源:network.php


示例13: check_admin_referer

     check_admin_referer('edit-plugin_' . $file);
     $newcontent = wp_unslash($_POST['newcontent']);
     if (is_writeable($real_file)) {
         $f = fopen($real_file, 'w+');
         fwrite($f, $newcontent);
         fclose($f);
         $network_wide = is_plugin_active_for_network($file);
         // Deactivate so we can test it.
         if (is_plugin_active($file) || isset($_POST['phperror'])) {
             if (is_plugin_active($file)) {
                 deactivate_plugins($file, true);
             }
             if (!is_network_admin()) {
                 update_option('recently_activated', array($file => time()) + (array) get_option('recently_activated'));
             } else {
                 update_network_option('recently_activated', array($file => time()) + (array) get_network_option('recently_activated'));
             }
             wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file={$file}&liveupdate=1&scrollto={$scrollto}&networkwide=" . $network_wide));
             exit;
         }
         wp_redirect(self_admin_url("plugin-editor.php?file={$file}&a=te&scrollto={$scrollto}"));
     } else {
         wp_redirect(self_admin_url("plugin-editor.php?file={$file}&scrollto={$scrollto}"));
     }
     exit;
 default:
     if (isset($_GET['liveupdate'])) {
         check_admin_referer('edit-plugin-test_' . $file);
         $error = validate_plugin($file);
         if (is_wp_error($error)) {
             wp_die($error);
开发者ID:9time,项目名称:WordPress,代码行数:31,代码来源:plugin-editor.php


示例14: delete_blog

 /**
  * Remove deleted blog from 'inpsyde_multilingual' site option and clean up linked elements table.
  *
  * @wp-hook delete_blog
  *
  * @param int $blog_id ID of the deleted blog.
  *
  * @return void
  */
 public function delete_blog($blog_id)
 {
     global $wpdb;
     // Delete relations
     $site_relations = $this->plugin_data->get('site_relations');
     $site_relations->delete_relation($blog_id);
     // Update network option.
     $blogs = get_network_option(null, 'inpsyde_multilingual', []);
     if (isset($blogs[$blog_id])) {
         unset($blogs[$blog_id]);
         update_site_option('inpsyde_multilingual', $blogs);
     }
     $table = $this->container['multilingualpress.content_relations_table']->name();
     // Clean up linked elements table
     $sql = "\n\t\t\tDELETE\n\t\t\tFROM {$table}\n\t\t\tWHERE ml_source_blogid = %d\n\t\t\t\tOR ml_blogid = %d";
     $sql = $wpdb->prepare($sql, $blog_id, $blog_id);
     $wpdb->query($sql);
 }
开发者ID:inpsyde,项目名称:multilingual-press,代码行数:27,代码来源:Multilingual_Press.php


示例15: _e

			<li><p><?php 
    _e('Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.');
    ?>
</p></li>
			<li><?php 
    printf(__('Have you entered your email correctly? You have entered %s, if it&#8217;s incorrect, you will not receive your email.'), $user_email);
    ?>
</li>
		</ul>
	</p>
	<?php 
    /** This action is documented in wp-signup.php */
    do_action('signup_finished');
}
// Main
$active_signup = get_network_option('registration', 'none');
/**
 * Filter the type of site sign-up.
 *
 * @since 3.0.0
 *
 * @param string $active_signup String that returns registration type. The value can be
 *                              'all', 'none', 'blog', or 'user'.
 */
$active_signup = apply_filters('wpmu_active_signup', $active_signup);
// Make the signup type translatable.
$i18n_signup['all'] = _x('all', 'Multisite active signup type');
$i18n_signup['none'] = _x('none', 'Multisite active signup type');
$i18n_signup['blog'] = _x('blog', 'Multisite active signup type');
$i18n_signup['user'] = _x('user', 'Multisite active signup type');
if (is_super_admin()) {
开发者ID:9time,项目名称:WordPress,代码行数:31,代码来源:wp-signup.php


示例16: prepare_items

 /**
  *
  * @global string $status
  * @global type   $plugins
  * @global array  $totals
  * @global int    $page
  * @global string $orderby
  * @global string $order
  * @global string $s
  */
 public function prepare_items()
 {
     global $status, $plugins, $totals, $page, $orderby, $order, $s;
     wp_reset_vars(array('orderby', 'order', 's'));
     /**
      * Filter the full array of plugins to list in the Plugins list table.
      *
      * @since 3.0.0
      *
      * @see get_plugins()
      *
      * @param array $plugins An array of plugins to display in the list table.
      */
     $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 = $this->screen;
     if (!is_multisite() || $screen->in_admin('network') && current_user_can('manage_network_plugins')) {
         /**
          * Filter whether to display the advanced plugins list table.
          *
          * There are two types of advanced plugins - must-use and drop-ins -
          * which can be used in a single site or Multisite network.
          *
          * The $type parameter allows you to differentiate between the type of advanced
          * plugins to filter the display of. Contexts include 'mustuse' and 'dropins'.
          *
          * @since 3.0.0
          *
          * @param bool   $show Whether to show the advanced plugins for the specified
          *                     plugin type. Default true.
          * @param string $type The plugin type. Accepts 'mustuse', 'dropins'.
          */
         if (apply_filters('show_advanced_plugins', true, 'mustuse')) {
             $plugins['mustuse'] = get_mu_plugins();
         }
         /** This action is documented in wp-admin/includes/class-wp-plugins-list-table.php */
         if (apply_filters('show_advanced_plugins', true, 'dropins')) {
             $plugins['dropins'] = get_dropins();
         }
         if (current_user_can('update_plugins')) {
             $current = get_site_transient('update_plugins');
             foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
                 if (isset($current->response[$plugin_file])) {
                     $plugins['all'][$plugin_file]['update'] = true;
                     $plugins['upgrade'][$plugin_file] = $plugins['all'][$plugin_file];
                 }
             }
         }
     }
     set_transient('plugin_slugs', array_keys($plugins['all']), DAY_IN_SECONDS);
     if ($screen->in_admin('network')) {
         $recently_activated = get_network_option('recently_activated', array());
     } else {
         $recently_activated = get_option('recently_activated', array());
     }
     foreach ($recently_activated as $key => $time) {
         if ($time + WEEK_IN_SECONDS < time()) {
             unset($recently_activated[$key]);
         }
     }
     if ($screen->in_admin('network')) {
         update_network_option('recently_activated', $recently_activated);
     } else {
         update_option('recently_activated', $recently_activated);
     }
     $plugin_info = get_site_transient('update_plugins');
     foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) {
         // Extra info if known. array_merge() ensures $plugin_data has precedence if keys collide.
         if (isset($plugin_info->response[$plugin_file])) {
             $plugins['all'][$plugin_file] = $plugin_data = array_merge((array) $plugin_info->response[$plugin_file], $plugin_data);
             // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
             if (isset($plugins['upgrade'][$plugin_file])) {
                 $plugins['upgrade'][$plugin_file] = $plugin_data = array_merge((array) $plugin_info->response[$plugin_file], $plugin_data);
             }
         } elseif (isset($plugin_info->no_update[$plugin_file])) {
             $plugins['all'][$plugin_file] = $plugin_data = array_merge((array) $plugin_info->no_update[$plugin_file], $plugin_data);
             // Make sure that $plugins['upgrade'] also receives the extra info since it is used on ?plugin_status=upgrade
             if (isset($plugins['upgrade'][$plugin_file])) {
                 $plugins['upgrade'][$plugin_file] = $plugin_data = array_merge((array) $plugin_info->no_update[$plugin_file], $plugin_data);
             }
         }
         // Filter into individual sections
         if (is_multisite() && !$screen->in_admin('network') && is_network_only_plugin($plugin_file) && !is_plugin_active($plugin_file)) {
             // On the non-network screen, filter out network-only plugins as long as they're not individually activated
             unset($plugins['all'][$plugin_file]);
         } elseif (!$screen->in_admin('network') && is_plugin_active_for_network($plugin_file)) {
             // On the non-network screen, filter out network activated plugins
             unset($plugins['all'][$plugin_file]);
         } elseif (!$screen->in_admin('network') && is_plugin_active($plugin_file) || $screen->in_admin('network') && is_plugin_active_for_network($plugin_file)) {
             // On the non-network screen, populate the active list with plugins that are individually activated
             // On the network-admin screen, populate the active list with plugins that are network activated
//.........这里部分代码省略.........
开发者ID:9time,项目名称:WordPress,代码行数:101,代码来源:class-wp-plugins-list-table.php


示例17: __

                echo '<option value="" selected="selected">' . __('&mdash; No role for this site &mdash;') . '</option>';
            }
            ?>
</select></td></tr>
<?php 
        }
        //!IS_PROFILE_PAGE
        if (is_multisite() && is_network_admin() && !IS_PROFILE_PAGE && current_user_can('manage_network_options') && !isset($super_admins)) {
            ?>
<tr class="user-super-admin-wrap"><th><?php 
            _e('Super Admin');
            ?>
</th>
<td>
<?php 
            if ($profileuser->user_email != get_network_option('admin_email') || !is_super_admin($profileuser->ID)) {
                ?>
<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php 
                checked(is_super_admin($profileuser->ID));
                ?>
 /> <?php 
                _e('Grant this user super admin privileges for the Network.');
                ?>
</label></p>
<?php 
            } else {
                ?>
<p><?php 
                _e('Super admin privileges cannot be removed because this user has the network admin email.');
                ?>
</p>
开发者ID:riasnelli,项目名称:WordPress,代码行数:31,代码来源:user-edit.php


示例18: wp_get_user_contact_methods

/**
 * Set up the user contact methods.
 *
 * Default contact methods were removed in 3.6. A filter dictates contact methods.
 *
 * @since 3.7.0
 *
 * @param WP_User $user Optional. WP_User object.
 * @return array Array of contact methods and their labels.
 */
function wp_get_user_contact_methods($user = null)
{
    $methods = array();
    if (get_network_option('initial_db_version') < 23588) {
        $methods = array('aim' => __('AIM'), 'yim' => __('Yahoo IM'), 'jabber' => __('Jabber / Google Talk'));
    }
    /**
     * Filter the user contact methods.
     *
     * @since 2.9.0
     *
     * @param array   $methods Array of contact methods and their labels.
     * @param WP_User $user    WP_User object.
     */
    return apply_filters('user_contactmethods', $methods, $user);
}
开发者ID:richardtape,项目名称:WordPress,代码行数:26,代码来源:user-functions.php


示例19: wp_load_core_site_options

        }
    }
    $blog_id = $current_blog->blog_id;
    $public = $current_blog->public;
    if (empty($current_blog->site_id)) {
        // This dates to [MU134] and shouldn't be relevant anymore,
        // but it could be possible for arguments passed to insert_blog() etc.
        $current_blog->site_id = 1;
    }
    $site_id = $current_blog->site_id;
    wp_load_core_site_options($site_id);
}
$wpdb->set_prefix($table_prefix, false);
// $table_prefix can be set in sunrise.php
$wpdb->set_blog_id($current_blog->blog_id, $current_blog->site_id);
$table_prefix = $wpdb->get_blog_prefix();
$_wp_switched_stack = array();
$switched = false;
// need to init cache again after blog_id is set
wp_start_object_cache();
if (!$current_site instanceof WP_Network) {
    $current_site = new WP_Network($current_site);
}
if (empty($current_site->site_name)) {
    $current_site->site_name = get_network_option('site_name');
    if (!$current_site->site_name) {
        $current_site->site_name = ucfirst($current_site->domain);
    }
}
// Define upload directory constants
ms_upload_constants();
开发者ID:9time,项目名称:WordPress,代码行数:31,代码来源:ms-settings.php


示例20: wpmn_edit_network_publish_metabox

/**
 * Metabox used to publish the network
 *
 * @since 1.7.0
 *
 * @param WP_Network $network
 */
function wpmn_edit_network_publish_metabox($network = null)
{
    // Network ID
    $network_id = empty($network) ? 0 : $network->id;
    // Button text
    $button_text = empty($network) ? esc_html__('Create', 'wp-multi-network') : esc_html__('Update', 'wp-multi-network');
    // Button action
    $action = empty($network) ? 'create' : 'update';
    // Cancel URL
    $cancel_url = add_query_arg(array('page' => 'networks'), network_admin_url('admin.php'));
    ?>

	<div class="submitbox">
		<div id="minor-publishing">
			<div id="misc-publishing-actions">

				<?php 
    if (!empty($network)) {
        ?>

					<div class="misc-pub-section misc-pub-section-first" id="network">
						<span><?php 
        printf(__('Name: <strong>%1$s</strong>', 'wp-multi-network'), get_network_option($network->id, 'site_name'));
        ?>
</span>
					</div>
					<div class="misc-pub-section misc-pub-section-last" id="sites">
						<span><?php 
        printf(__('Sites: <strong>%1$s</strong>', 'wp-multi-network'), get_network_option($network->id, 'blog_count'));
        ?>
</span>
					</div>

				<?php 
    } else {
        ?>

					<div class="misc-pub-section misc-pub-section-first" id="sites">
						<span><?php 
        esc_html_e('Creating a network with 1 new site.', 'wp-multi-network');
        ?>
</span>
					</div>

				<?php 
    }
    ?>

			</div>

			<div class="clear"></div>
		</div>

		<div id="major-publishing-actions">
			<a class="button" href="<?php 
    echo esc_url($cancel_url);
    ?>
"><?php 
    esc_html_e('Cancel', 'wp-multi-network');
    ?>
</a>
			<div id="publishing-action">
				<?php 
    wp_nonce_field('edit_network', 'network_edit');
    submit_button($button_text, 'primary', 'submit', false);
    ?>
				<input type="hidden" name="action" value="<?php 
    echo esc_attr($action);
    ?>
">
				<input type="hidden" name="network_id" value="<?php 
    echo esc_attr($network_id);
    ?>
">
			</div>
			<div class="clear"></div>
		</div>
	</div>

<?php 
}
开发者ID:stuttter,项目名称:wp-multi-network,代码行数:88,代码来源:edit-network.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_new_importcode函数代码示例发布时间:2022-05-15
下一篇:
PHP get_network_css函数代码示例发布时间: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