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

PHP is_multisite函数代码示例

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

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



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

示例1: wppb_check_email_value

function wppb_check_email_value($message, $field, $request_data, $form_location)
{
    global $wpdb;
    if (isset($request_data['email']) && trim($request_data['email']) == '' && $field['required'] == 'Yes') {
        return wppb_required_field_error($field["field-title"]);
    }
    if (isset($request_data['email']) && !is_email(trim($request_data['email']))) {
        return __('The email you entered is not a valid email address.', 'profilebuilder');
    }
    if (is_multisite() || !is_multisite() && (isset($wppb_generalSettings['emailConfirmation']) && $wppb_generalSettings['emailConfirmation'] == 'yes')) {
        $user_signup = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "signups WHERE user_email = %s", $request_data['email']));
        if (!empty($user_signup)) {
            return __('This email is already reserved to be used soon.', 'profilebuilder') . '<br/>' . __('Please try a different one!', 'profilebuilder');
        }
    }
    $users = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->users} WHERE user_email = %s", $request_data['email']));
    if (!empty($users)) {
        if ($form_location == 'register') {
            return __('This email is already in use.', 'profilebuilder') . '<br/>' . __('Please try a different one!', 'profilebuilder');
        }
        if ($form_location == 'edit_profile') {
            $current_user = wp_get_current_user();
            foreach ($users as $user) {
                if ($user->ID != $current_user->ID) {
                    return __('This email is already in use.', 'profilebuilder') . '<br/>' . __('Please try a different one!', 'profilebuilder');
                }
            }
        }
    }
    return $message;
}
开发者ID:DarussalamTech,项目名称:aims_prj,代码行数:31,代码来源:email.php


示例2: wpgmp_network_propagate

/**
 * This function used to install required tables in the database on time of activation.
 * @author Flipper Code <[email protected]>
 * @version 1.0.0
 * @package Maps
 */
function wpgmp_network_propagate($network_wide)
{
    if (is_multisite() && $network_wide) {
        // See if being activated on the entire network or one blog
        global $wpdb;
        // Get this so we can switch back to it later
        $currentblog = $wpdb->blogid;
        // For storing the list of activated blogs
        $activated = array();
        // Get all blogs in the network and activate plugin on each one
        $sql = "SELECT blog_id FROM {$wpdb->blogs}";
        $blog_ids = $wpdb->get_col($wpdb->prepare($sql, null));
        foreach ($blog_ids as $blog_id) {
            switch_to_blog($blog_id);
            wpgmp_activation();
        }
        // Switch back to the current blog
        switch_to_blog($currentblog);
        // Store the array for a later function
        update_site_option('wpgmp_activated', $activated);
    } else {
        // Running on a single blog
        wpgmp_activation();
    }
}
开发者ID:manhhung86it,项目名称:builder-site,代码行数:31,代码来源:wp-google-map-plugin.php


示例3: show_license_form

 /**
  * Show a form where users can enter their license key
  * Takes Multisites into account
  *
  * @param bool $embedded
  * @return null
  */
 public function show_license_form($embedded = true)
 {
     // For non-multisites, always show the license form
     if (!is_multisite()) {
         parent::show_license_form($embedded);
         return;
     }
     // Plugin is network activated
     if ($this->is_network_activated) {
         // We're on the network admin
         if (is_network_admin()) {
             parent::show_license_form($embedded);
         } else {
             // We're not in the network admin area, show a notice
             parent::show_license_form_heading();
             if (is_super_admin()) {
                 echo "<p>" . sprintf(__('%s is network activated, you can manage your license in the <a href="%s">network admin license page</a>.', $this->product->get_text_domain()), $this->product->get_item_name(), $this->product->get_license_page_url()) . "</p>";
             } else {
                 echo "<p>" . sprintf(__('%s is network activated, please contact your site administrator to manage the license.', $this->product->get_text_domain()), $this->product->get_item_name()) . "</p>";
             }
         }
     } else {
         if (false == is_network_admin()) {
             parent::show_license_form($embedded);
         }
     }
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:34,代码来源:class-plugin-license-manager.php


示例4: wppa_delete_from_cloudinary

function wppa_delete_from_cloudinary($id)
{
    $prefix = is_multisite() && !WPPA_MULTISITE_GLOBAL ? $blog_id . '-' : '';
    $pub_id = $prefix . $id;
    $args = array("invalidate" => true);
    \Cloudinary\Uploader::destroy($pub_id, $args);
}
开发者ID:billadams,项目名称:forever-frame,代码行数:7,代码来源:wppa-cloudinary.php


示例5: run

 function run()
 {
     $this->settings = get_site_option('itsec_hide_backend');
     //Execute module functions on frontend init
     if ($this->settings['enabled'] === true) {
         $jetpack_active_modules = get_option('jetpack_active_modules');
         if (is_multisite() && function_exists('is_plugin_active_for_network')) {
             //see if Jetpack is active
             $is_jetpack_active = in_array('jetpack/jetpack.php', (array) get_option('active_plugins', array())) || is_plugin_active_for_network('jetpack/jetpack.php');
         } else {
             $is_jetpack_active = in_array('jetpack/jetpack.php', (array) get_option('active_plugins', array()));
         }
         if (!($is_jetpack_active === true && is_array($jetpack_active_modules) && in_array('json-api', $jetpack_active_modules) && isset($_GET['action']) && $_GET['action'] == 'jetpack_json_api_authorization')) {
             $this->auth_cookie_expired = false;
             add_action('auth_cookie_expired', array($this, 'auth_cookie_expired'));
             add_action('init', array($this, 'execute_hide_backend'), 1000);
             add_action('login_init', array($this, 'execute_hide_backend_login'));
             add_action('plugins_loaded', array($this, 'plugins_loaded'), 11);
             add_filter('body_class', array($this, 'remove_admin_bar'));
             add_filter('loginout', array($this, 'filter_loginout'));
             add_filter('wp_redirect', array($this, 'filter_login_url'), 10, 2);
             add_filter('lostpassword_url', array($this, 'filter_login_url'), 10, 2);
             add_filter('site_url', array($this, 'filter_login_url'), 10, 2);
             add_filter('retrieve_password_message', array($this, 'retrieve_password_message'));
             add_filter('comment_moderation_text', array($this, 'comment_moderation_text'));
             remove_action('template_redirect', 'wp_redirect_admin_locations', 1000);
         }
     }
 }
开发者ID:Garth619,项目名称:DMA-Franconnect-Local,代码行数:29,代码来源:class-itsec-hide-backend.php


示例6: getNotWebCachePath

 public static function getNotWebCachePath()
 {
     if (is_multisite()) {
         return self::getBasePath() . '/cache/nextend/notweb' . get_current_blog_id();
     }
     return self::getBasePath() . '/cache/nextend/notweb';
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:7,代码来源:filesystem.php


示例7: __construct

 /**
  * Class constructor
  */
 function __construct()
 {
     $this->options = WPSEO_Options::get_all();
     if (is_multisite()) {
         WPSEO_Options::maybe_set_multisite_defaults(false);
     }
     if ($this->options['stripcategorybase'] === true) {
         add_action('created_category', array($this, 'schedule_rewrite_flush'));
         add_action('edited_category', array($this, 'schedule_rewrite_flush'));
         add_action('delete_category', array($this, 'schedule_rewrite_flush'));
     }
     $this->page_gsc = new WPSEO_GSC();
     $this->dashboard_widget = new Yoast_Dashboard_Widget();
     // Needs the lower than default priority so other plugins can hook underneath it without issue.
     add_action('admin_menu', array($this, 'register_settings_page'), 5);
     add_action('network_admin_menu', array($this, 'register_network_settings_page'));
     add_filter('plugin_action_links_' . WPSEO_BASENAME, array($this, 'add_action_link'), 10, 2);
     add_action('admin_enqueue_scripts', array($this, 'config_page_scripts'));
     if ('0' == get_option('blog_public')) {
         add_action('admin_footer', array($this, 'blog_public_warning'));
     }
     if ((isset($this->options['theme_has_description']) && $this->options['theme_has_description'] === true || $this->options['theme_description_found'] !== '') && $this->options['ignore_meta_description_warning'] !== true) {
         add_action('admin_footer', array($this, 'meta_description_warning'));
     }
     if ($this->options['cleanslugs'] === true) {
         add_filter('name_save_pre', array($this, 'remove_stopwords_from_slug'), 0);
     }
     add_filter('user_contactmethods', array($this, 'update_contactmethods'), 10, 1);
     add_action('after_switch_theme', array($this, 'switch_theme'));
     add_action('switch_theme', array($this, 'switch_theme'));
     add_filter('set-screen-option', array($this, 'save_bulk_edit_options'), 10, 3);
     add_action('admin_init', array('WPSEO_Plugin_Conflict', 'hook_check_for_plugin_conflicts'), 10, 1);
     add_action('admin_init', array($this, 'import_plugin_hooks'));
     WPSEO_Utils::register_cache_clear_option('wpseo', '');
 }
开发者ID:jianqiangsong,项目名称:WordPress,代码行数:38,代码来源:class-admin.php


示例8: process

 public function process()
 {
     $conds = apply_filters('qm/collect/conditionals', array('is_404', 'is_admin', 'is_archive', 'is_attachment', 'is_author', 'is_blog_admin', 'is_category', 'is_comment_feed', 'is_customize_preview', 'is_date', 'is_day', 'is_embed', 'is_feed', 'is_front_page', 'is_home', 'is_main_network', 'is_main_site', 'is_month', 'is_network_admin', 'is_page', 'is_page_template', 'is_paged', 'is_post_type_archive', 'is_preview', 'is_robots', 'is_rtl', 'is_search', 'is_single', 'is_singular', 'is_ssl', 'is_sticky', 'is_tag', 'is_tax', 'is_time', 'is_trackback', 'is_user_admin', 'is_year'));
     $conds = apply_filters('query_monitor_conditionals', $conds);
     $true = $false = $na = array();
     foreach ($conds as $cond) {
         if (function_exists($cond)) {
             if ('is_sticky' === $cond and !get_post($id = null)) {
                 # Special case for is_sticky to prevent PHP notices
                 $false[] = $cond;
             } else {
                 if (!is_multisite() and in_array($cond, array('is_main_network', 'is_main_site'))) {
                     # Special case for multisite conditionals to prevent them from being annoying on single site installs
                     $na[] = $cond;
                 } else {
                     if (call_user_func($cond)) {
                         $true[] = $cond;
                     } else {
                         $false[] = $cond;
                     }
                 }
             }
         } else {
             $na[] = $cond;
         }
     }
     $this->data['conds'] = compact('true', 'false', 'na');
 }
开发者ID:L0k1slnk,项目名称:weddly,代码行数:28,代码来源:conditionals.php


示例9: 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


示例10: convert_the_content_images_to_cloudinary_pull_request

 /**
  * Filter the raw post content and replace any images that are "local" with cloudinary images
  */
 static function convert_the_content_images_to_cloudinary_pull_request($content)
 {
     if (!in_the_loop()) {
         return $content;
     }
     //setup account name for use with get_cdn_prefix()
     $account = static::get_option_value('cloud_name');
     //if there is no account set, do not continue
     if (empty($account)) {
         return $content;
     }
     //prepare new values for use in string replacements
     $cdn_fetch_prefix_no_protocal = static::get_cdn_prefix($account);
     $site_url = get_bloginfo('url');
     $site_url_no_protocal = preg_replace('/http[s]?:\\/\\//', '', $site_url);
     $cdn_content = $content;
     //prepare for multisite, switch location of images to actual source
     if (is_multisite()) {
         global $blog_id;
         //fix rewrite urls to go directly to the file within the multisite subfolder
         $cdn_content = str_replace($site_url . '/files/', $site_url . '/wp-content/blogs.dir/' . $blog_id . '/files/', $cdn_content);
     }
     //move any images that match the site source to pull them from the cdn
     $cdn_fetch_options = static::get_cdn_options();
     $cdn_content = preg_replace_callback("/<img(.*)src=\"(http:|https:)?\\/\\/(" . $site_url_no_protocal . ")(\\/.*\\/)((.*-(\\d{3})x(\\d{3}))|.*)?(\\.[a-zA-Z]{3,4}\")([^>]+>)/im", array(get_called_class(), 'callback_convert_image_source_to_cdn_url'), $cdn_content);
     //if preg replace function worked correctly, use the new CDN content
     if (!empty($cdn_content)) {
         return $cdn_content;
     }
     //otherwise return the regular content
     return $content;
 }
开发者ID:WordPress-Phoenix,项目名称:wordpress-cloudinary-config-free-cdn-images,代码行数:35,代码来源:sm-cloudinary-config-free-cdn-images.php


示例11: sc_get_details

 /**
  * Handles the Shortcode for: `[s2Get /]`.
  *
  * @package s2Member\s2Get
  * @since 3.5
  *
  * @attaches-to ``add_shortcode("s2Get");``
  *
  * @param array $attr An array of Attributes.
  * @param string $content Content inside the Shortcode.
  * @param string $shortcode The actual Shortcode name itself.
  * @return mixed Value of the requested data, or null on failure.
  *
  * @todo Prevent this routine from potentially returning objects/arrays?
  */
 public static function sc_get_details($attr = FALSE, $content = FALSE, $shortcode = FALSE)
 {
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_sc_get_details", get_defined_vars());
     unset($__refs, $__v);
     $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array) $attr);
     // Force array; trim quote entities.
     $attr = shortcode_atts(array("constant" => "", "user_field" => "", "user_option" => "", "user_id" => ""), $attr);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_before_sc_get_details_after_shortcode_atts", get_defined_vars());
     unset($__refs, $__v);
     if ($attr["constant"] && defined($attr["constant"])) {
         if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site() || preg_match("/^S2MEMBER_/i", $attr["constant"])) {
             $get = constant($attr["constant"]);
         }
     } else {
         if ($attr["user_field"] && (is_user_logged_in() || $attr["user_id"])) {
             $get = c_ws_plugin__s2member_utils_users::get_user_field($attr["user_field"], (int) $attr["user_id"]);
         } else {
             if ($attr["user_option"] && (is_user_logged_in() || $attr["user_id"])) {
                 $get = get_user_option($attr["user_option"], (int) $attr["user_id"]);
             }
         }
     }
     return apply_filters("ws_plugin__s2member_sc_get_details", isset($get) ? $get : null, get_defined_vars());
 }
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:45,代码来源:sc-gets-in.inc.php


示例12: initialize

 public function initialize()
 {
     $this->user = new stdClass();
     if (is_user_logged_in()) {
         /* Populate settings we need for the menu based on the current user. */
         $this->user->blogs = get_blogs_of_user(get_current_user_id());
         if (is_multisite()) {
             $this->user->active_blog = get_active_blog_for_user(get_current_user_id());
             $this->user->domain = empty($this->user->active_blog) ? user_admin_url() : trailingslashit(get_home_url($this->user->active_blog->blog_id));
             $this->user->account_domain = $this->user->domain;
         } else {
             $this->user->active_blog = $this->user->blogs[get_current_blog_id()];
             $this->user->domain = trailingslashit(home_url());
             $this->user->account_domain = $this->user->domain;
         }
     }
     add_action('wp_head', 'wp_admin_bar_header');
     add_action('admin_head', 'wp_admin_bar_header');
     if (current_theme_supports('admin-bar')) {
         $admin_bar_args = get_theme_support('admin-bar');
         // add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
         $header_callback = $admin_bar_args[0]['callback'];
     }
     if (empty($header_callback)) {
         $header_callback = '_admin_bar_bump_cb';
     }
     add_action('wp_head', $header_callback);
     wp_enqueue_script('admin-bar');
     wp_enqueue_style('admin-bar');
     do_action('admin_bar_init');
 }
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:31,代码来源:class-wp-admin-bar.php


示例13: jr_mt_settings_page

/**
 * Settings page for plugin
 * 
 * Display and Process Settings page for this plugin.
 *
 */
function jr_mt_settings_page()
{
    echo '<div class="wrap">';
    screen_icon('plugins');
    echo '<h2>jonradio Multiple Themes</h2>';
    //	Required because it is only called automatically for Admin Pages in the Settings section
    settings_errors('jr_mt_settings');
    $theme = wp_get_theme()->Name;
    global $jr_mt_options_cache;
    ?>
	<p>This plugin allows you to selectively change the Theme you have selected as your <b>Current Theme</b> in <b>Appearance-Themes</b> on the Admin panels.
	You can choose from any of the <b>Available Themes</b> listed on the Appearance-Themes Admin panel for:
	<ul>
	<li> &raquo; All Pages</li>
	<li> &raquo; All Posts</li>
	<li> &raquo; The Site Home</li>
	<li> &raquo; A Specific Page</li>
	<li> &raquo; A Specific Post</li>
	<li> &raquo; Any other non-Admin page that has its own Permalink; for example, a specific Archive or Category page</li>
	</ul>
	<?php 
    if (function_exists('is_multisite') && is_multisite()) {
        echo "In a WordPress Network (AKA Multisite), Themes must be <b>Network Enabled</b> before they will appear as Available Themes on individual sites' Appearance-Themes panel.";
    }
    echo '</p>';
    echo '<p>';
    echo "The Current Theme is <b>{$theme}</b>. You will not normally need to specify it in any of the Settings on this page. The only exception would be if you specify a different Theme for All Pages or All Posts and wish to use the Current Theme for a specific Page, Post or other non-Admin page.";
    echo '</p>';
    echo '<form action="options.php" method="POST">';
    //	Plugin Settings are displayed and entered here:
    settings_fields('jr_mt_settings');
    do_settings_sections('jr_mt_settings_page');
    echo '<p><input name="save" type="submit" value="Save Changes" class="button-primary" /></p></form>';
}
开发者ID:JalpMi,项目名称:v2contact,代码行数:40,代码来源:admin.php


示例14: flashCache

 /**
  * Flash all cache
  *
  * @return boolean
  *
  * @access public
  */
 public function flashCache()
 {
     global $wpdb;
     //clear visitor's cache first
     if (is_multisite()) {
         //get all sites first and iterate through each
         $query = 'SELECT blog_id FROM ' . $wpdb->blogs;
         $blog_list = $wpdb->get_results($query);
         if (is_array($blog_list)) {
             foreach ($blog_list as $blog) {
                 $query = 'DELETE FROM ' . $wpdb->get_blog_prefix($blog->blog_id) . 'options ';
                 $query .= 'WHERE `option_name` = "aam_visitor_cache"';
                 $wpdb->query($query);
             }
         }
     } else {
         $query = 'DELETE FROM ' . $wpdb->options . ' ';
         $query .= 'WHERE `option_name` = "aam_visitor_cache"';
         $wpdb->query($query);
     }
     //clear users cache
     $query = 'DELETE FROM ' . $wpdb->usermeta . ' ';
     $query .= 'WHERE `meta_key` = "aam_cache"';
     $wpdb->query($query);
     return true;
 }
开发者ID:dot2006,项目名称:jobify,代码行数:33,代码来源:update.php


示例15: init

 function init()
 {
     global $cms_nav_ie_ver;
     $this->plugin_localization();
     // Check if WPML is active. If not display warning message and not load CMS Navigation
     if (!defined('ICL_SITEPRESS_VERSION') || ICL_PLUGIN_INACTIVE) {
         if (!function_exists('is_multisite') || !is_multisite()) {
             add_action('admin_notices', array($this, '_no_wpml_warning'));
         }
         return false;
     } elseif (version_compare(ICL_SITEPRESS_VERSION, '2.0.5', '<')) {
         add_action('admin_notices', array($this, '_old_wpml_warning'));
         return false;
     }
     // Load plugin settings
     $this->settings = get_option('wpml_cms_nav_settings');
     // Use WPML legacy. Read settings from WPML if they exist there.
     if (empty($this->settings) && defined('ICL_SITEPRESS_VERSION')) {
         require_once WPML_CMS_NAV_PLUGIN_PATH . '/inc/cms-navigation-schema.php';
         wpml_cms_nav_default_settings();
     }
     // Initialize cache
     $this->cache['offsite_url_cache'] = new wpml_cms_nav_cache('cms_nav_offsite_url', true);
     // Determine User agent to be used in rendering the menu correctly for IE
     $cms_nav_user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : false;
     if ($cms_nav_user_agent && preg_match('#MSIE ([0-9]+)\\.[0-9]#', $cms_nav_user_agent, $matches)) {
         $cms_nav_ie_ver = $matches[1];
     }
     // Setup the WP-Admin resources
     add_action('admin_init', array($this, 'admin_init'));
     // Setup the WP-Admin menus
     add_action('admin_menu', array($this, 'menu'));
     // Clear cache hook
     add_action('wp_ajax_wpml_cms_nav_clear_nav_cache', array($this, 'clear_cache'));
     // Save form(options) hook
     add_action('wp_ajax_wpml_cms_nav_save_form', array($this, 'save_form'));
     // theme hooks
     add_action('icl_navigation_breadcrumb', array($this, 'cms_navigation_breadcrumb'));
     add_action('icl_navigation_menu', array($this, 'cms_navigation_menu_nav'));
     add_action('icl_navigation_sidebar', array($this, 'cms_navigation_page_navigation'));
     // more hooks
     add_action('save_post', array($this, 'cms_navigation_update_post_settings'), 4, 2);
     add_action('admin_head', array($this, 'cms_navigation_page_edit_options'));
     add_action('admin_head', array($this, 'cms_navigation_js'));
     // offsite urls hooks
     add_filter('page_link', array($this, 'rewrite_page_link'), 15, 2);
     add_action('parse_query', array($this, 'redirect_offsite_urls'));
     // situations to clear the cache
     add_filter('permalink_structure_changed', array($this, 'clear_cache'));
     add_filter('update_option_show_on_front', array($this, 'clear_cache'));
     add_filter('update_option_page_on_front', array($this, 'clear_cache'));
     add_filter('update_option_page_for_posts', array($this, 'clear_cache'));
     add_action('delete_post', array($this, 'clear_cache'));
     add_action('delete_category', array($this, 'clear_cache'));
     add_action('create_category', array($this, 'clear_cache'));
     add_action('edited_category', array($this, 'clear_cache'));
     // add message to WPML dashboard widget
     add_action('icl_dashboard_widget_content', array($this, 'icl_dashboard_widget_content'));
     return true;
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:60,代码来源:cms-navigation.class.php


示例16: WYSIJA_help_queue

 /**
  *
  */
 function WYSIJA_help_queue()
 {
     $this->config = WYSIJA::get('config', 'model');
     $this->subClass = WYSIJA::get('user', 'model');
     //acymailing_get('class.sub');
     $this->listsubClass = WYSIJA::get('user_list', 'model');
     //acymailing_get('class.listsub');
     $this->listsubClass->checkAccess = false;
     $this->listsubClass->sendNotif = false;
     $this->listsubClass->sendConf = false;
     $is_multisite = is_multisite();
     //$is_multisite=true;//PROD comment that line
     // get the right sending limit based on the setup we are on,
     // if we are on a multisite we need to see which sending method is used to determine that
     if ($is_multisite && $this->config->getValue('sending_method') == 'network') {
         $this->send_limit = (int) $this->config->getValue('ms_sending_emails_number');
     } else {
         $this->send_limit = (int) $this->config->getValue('sending_emails_number');
     }
     if (isset($_REQUEST['totalsend'])) {
         $this->send_limit = (int) $_REQUEST['totalsend'] - $_REQUEST['alreadysent'];
     }
     @ini_set('max_execution_time', 0);
     @ini_set('default_socket_timeout', 10);
     @ignore_user_abort(true);
     //we set a stoppage time to avoid broken process
     $time_limit = ini_get('max_execution_time');
     if (!empty($time_limit)) {
         $this->stoptime = time() + $time_limit - 4;
     }
 }
开发者ID:pablomarsan,项目名称:iftheme-docs,代码行数:34,代码来源:queue.php


示例17: get_actions

 /**
  * @see CPAC_Column_Actions::get_actions()
  * @since 2.4.7
  */
 public function get_actions($id)
 {
     $actions = array();
     $user_object = new WP_User($id);
     $screen = get_current_screen();
     if ('site-users-network' == $screen->id) {
         $url = "site-users.php?id={$this->site_id}&amp;";
     } else {
         $url = 'users.php?';
     }
     if (get_current_user_id() == $user_object->ID) {
         $edit_link = 'profile.php';
     } else {
         $edit_link = esc_url(add_query_arg('wp_http_referer', urlencode(stripslashes($_SERVER['REQUEST_URI'])), "user-edit.php?user_id={$user_object->ID}"));
     }
     if (current_user_can('edit_user', $user_object->ID)) {
         $edit = "<strong><a href=\"{$edit_link}\">{$user_object->user_login}</a></strong><br />";
         $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     } else {
         $edit = "<strong>{$user_object->user_login}</strong><br />";
     }
     if (!is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('delete_user', $user_object->ID)) {
         $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Delete') . "</a>";
     }
     if (is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('remove_user', $user_object->ID)) {
         $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url($url . "action=remove&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Remove') . "</a>";
     }
     return $actions;
 }
开发者ID:ltdat287,项目名称:id.nhomdichvu,代码行数:33,代码来源:actions.php


示例18: __construct

 public function __construct()
 {
     if (!is_multisite() || !c_ws_plugin__s2member_utils_conds::is_multisite_farm() || is_main_site()) {
         echo '<div class="ws-menu-page-group" title="Pro API For Remote Operations">' . "\n";
         echo '<div class="ws-menu-page-section ws-plugin--s2member-api-remote-operations-section">' . "\n";
         echo '<h3>Pro API For Remote Operations (PHP scripting required)</h3>' . "\n";
         echo '<p>With s2Member Pro installed, you have access to the s2Member Pro API For Remote Operations. This is made available for developers that wish to create User/Member accounts dynamically through custom scripts of their own. s2Member\'s Remote Operations API requires a secret API Key in order to POST authenticated requests to your installation of s2Member.</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operations API: <strong>Your secret API Key</strong></h4>' . "\n";
         echo '<input type="text" autocomplete="off" value="' . format_to_edit(c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen()) . '" style="width:99%;" />' . "\n";
         echo '<p><em><strong class="ws-menu-page-hilite">Experimental:</strong> The Remote Operations API is currently in an experimental state. The Operations that are currently possible include: <code>auth_check_user</code>, <code>get_user</code>, <code>create_user</code>, <code>modify_user</code>, <code>delete_user</code>. In a future release of s2Member Pro, we will add further documentation and some additional Remote Operations to this API. Thanks for your patience.</em></p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>auth_check_user</code> (authenticate existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-auth-check-user.x-php"))))) . '</p>' . "\n";
         echo '<h4>Remote Operation: <code>get_user</code> (retrieve data about existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-get-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>create_user</code> (or update existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-create-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>modify_user</code> (updates existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-modify-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<h4>Remote Operation: <code>delete_user</code> (deletes existing Users/Members)</h4>' . "\n";
         echo '<p>' . c_ws_plugin__s2member_utils_strings::highlight_php(str_replace("www.example.com", $_SERVER["HTTP_HOST"], str_replace("http://www.example.com/", site_url("/"), str_replace("[API Key]", c_ws_plugin__s2member_pro_remote_ops::remote_ops_key_gen(), file_get_contents(dirname(__FILE__) . "/code-samples/remote-op-delete-user.x-php"))))) . '</p>' . "\n";
         echo '<div class="ws-menu-page-hr"></div>' . "\n";
         echo '<p><strong>TIP:</strong> In addition to this documentation, you may also want to have a look at the <a href="http://www.s2member.com/codex/" target="_blank" rel="external">s2Member Codex</a>.<br />' . "\n";
         echo '<strong>See Also:</strong> <a href="http://www.s2member.com/codex/stable/s2member/api_constants/package-summary/" target="_blank" rel="external">s2Member Codex -› API Constants</a>, and <a href="http://www.s2member.com/codex/stable/s2member/api_functions/package-summary/" target="_blank" rel="external">s2Member Codex -› API Functions</a>.</p>' . "\n";
         echo '</div>' . "\n";
         echo '</div>' . "\n";
     }
 }
开发者ID:donwea,项目名称:nhap.org,代码行数:32,代码来源:scripting-api-remote-ops.inc.php


示例19: __construct

 /**
  * Construct
  */
 function __construct($type = 'mycred_default')
 {
     // Prep
     $this->is_multisite = is_multisite();
     $this->use_master_template = mycred_override_settings();
     $this->use_central_logging = mycred_centralize_log();
     if ($type == '' || $type === NULL) {
         $type = 'mycred_default';
     }
     // Load Settings
     $option_id = 'mycred_pref_core';
     if ($type != 'mycred_default' && $type != '') {
         $option_id .= '_' . $type;
     }
     $this->core = mycred_get_option($option_id, $this->defaults());
     if ($this->core !== false) {
         foreach ((array) $this->core as $key => $value) {
             $this->{$key} = $value;
         }
     }
     if ($type != '') {
         $this->cred_id = $type;
     }
     if (defined('MYCRED_LOG_TABLE')) {
         $this->log_table = MYCRED_LOG_TABLE;
     } else {
         global $wpdb;
         if ($this->is_multisite && $this->use_central_logging) {
             $this->log_table = $wpdb->base_prefix . 'myCRED_log';
         } else {
             $this->log_table = $wpdb->prefix . 'myCRED_log';
         }
     }
     do_action_ref_array('mycred_settings', array(&$this));
 }
开发者ID:suifengtec,项目名称:mycred,代码行数:38,代码来源:mycred-functions.php


示例20: init

 /**
  * Init Vindi_Dependencies.
  */
 public static function init()
 {
     self::$active_plugins = (array) get_option('active_plugins', array());
     if (is_multisite()) {
         self::$active_plugins = array_merge(self::$active_plugins, get_site_option('active_sitewide_plugins', array()));
     }
 }
开发者ID:vindi,项目名称:vindi-woocommerce-subscriptions,代码行数:10,代码来源:class-vindi-dependencies.php



注:本文中的is_mult


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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