当前位置: 首页>>代码示例>>PHP>>正文


PHP network_home_url函数代码示例

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


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

示例1: remote_request

 public static function remote_request($args)
 {
     $name = x_addons_get_api_key_option_name();
     $api_key = esc_attr(get_option($name));
     if ($api_key == '') {
         $api_key = 'unverified';
     }
     $args = wp_parse_args($args, array('action' => 'autoupdates', 'api-key' => $api_key, 'siteurl' => preg_replace('#(https?:)?//#', '', esc_attr(untrailingslashit(network_home_url()))), 'xversion' => X_VERSION));
     $request_url = self::$base_url . trailingslashit($args['action']) . trailingslashit($args['api-key']);
     unset($args['action']);
     unset($args['api-key']);
     $uri = add_query_arg($args, $request_url);
     $request = wp_remote_get($uri, array('timeout' => 15));
     $connection_error = array('code' => 4, 'message' => __('Could not establish connection. For assistance, please start by reviewing our article on troubleshooting <a href="https://community.theme.co/kb/connection-issues/">connection issues.</a>', '__x__'));
     if (is_wp_error($request) || $request['response']['code'] != 200) {
         self::store_error($request);
         return $connection_error;
     }
     $data = json_decode($request['body'], true);
     if (!isset($data['code'])) {
         return $connection_error;
     }
     //
     // Key was good but is now invalid (revoked).
     //
     if ($api_key != '' && $data['code'] == 3) {
         delete_option($name);
         delete_site_option('x_addon_list_cache');
     }
     return $data;
 }
开发者ID:skywindzz,项目名称:blue_leopard,代码行数:31,代码来源:class-update-api.php

示例2: setRulesFilters

 public static function setRulesFilters()
 {
     $home_url = parse_url(is_multisite() ? network_home_url('/') : home_url('/'));
     extract($home_url);
     self::$rules_filters = ['www\\.example\\.com' => preg_quote($host), 'www.example.com/' => $host . $path, 'www.example.com' => $host, '/wordpress' => parse_url(site_url(), PHP_URL_PATH)];
     self::$rules_filters = apply_filters('roots/h5bp-htaccess-filters', self::$rules_filters);
 }
开发者ID:webbab,项目名称:wp-h5bp-htaccess,代码行数:7,代码来源:wp-h5bp-htaccess.php

示例3: is_multisite_root

 function is_multisite_root()
 {
     if (is_multisite()) {
         return trailingslashit(get_home_url()) === trailingslashit(network_home_url()) ? true : false;
     }
     return true;
 }
开发者ID:sdellow,项目名称:wp-framework,代码行数:7,代码来源:wp-extensions.php

示例4: global_home_url

 function global_home_url($path = '', $scheme = null)
 {
     if (!is_multinetwork()) {
         return network_home_url($path, $scheme);
     }
     $main_site_id = get_main_network_id();
     $main_site = get_network($main_site_id);
     $orig_scheme = $scheme;
     if (!in_array($scheme, array('http', 'https', 'relative'))) {
         $scheme = is_ssl() && !is_admin() ? 'https' : 'http';
     }
     if ('relative' == $scheme) {
         $url = $main_site->path;
     } else {
         $url = set_url_scheme('http://' . $main_site->domain . $main_site->path, $scheme);
     }
     if ($path && is_string($path)) {
         $url .= ltrim($path, '/');
     }
     /**
      * Filters the global home URL.
      *
      * @since 1.0.0
      *
      * @param string      $url         The complete global home URL including scheme and path.
      * @param string      $path        Path relative to the global home URL. Blank string
      *                                 if no path is specified.
      * @param string|null $orig_scheme Scheme to give the URL context. Accepts 'http', 'https',
      *                                 'relative' or null.
      */
     return apply_filters('global_home_url', $url, $path, $orig_scheme);
 }
开发者ID:felixarntz,项目名称:global-admin,代码行数:32,代码来源:link-template.php

示例5: filter_body_class

 function filter_body_class($classes = array())
 {
     $return = $classes;
     $site_id = 0;
     $site_url = network_site_url();
     $home_url = network_home_url();
     if (is_multisite()) {
         $site_id = get_current_blog_id();
     }
     if (!empty($site_id)) {
         $arrReturn = 'site-id-' . $site_id;
     }
     if ($site_url != $home_url) {
         $arrReturn[] = 'site-url-' . $this->sanitize_url_class($site_url);
         $arrReturn[] = 'home-url-' . $this->sanitize_url_class($home_url);
     } else {
         $arrReturn[] = $this->sanitize_url_class($site_url);
     }
     if (!empty($arrReturn)) {
         if (!empty($classes)) {
             $return = array_unique($arrReturn + $classes);
         } else {
             $return = $arrReturn;
         }
     }
     return $return;
 }
开发者ID:ginsterbusch,项目名称:body-class-site-info,代码行数:27,代码来源:index.php

示例6: set_site_host

 function set_site_host()
 {
     $host = network_home_url();
     $host = parse_url($host);
     $host = $host['host'];
     $host = apply_filters('vp_seo_hide_site_host', $host);
     $this->site_host = $host;
 }
开发者ID:petrozavodsky,项目名称:seo_hide,代码行数:8,代码来源:vp-hidden-seo.php

示例7: wxr_site_url

/**
 * Return the URL of the site
 *
 * @since 2.5.0
 *
 * @return string Site URL.
 */
function wxr_site_url()
{
    // ms: the base url
    if (is_multisite()) {
        return network_home_url();
    } else {
        return get_site_url();
    }
}
开发者ID:arfianadam,项目名称:arfianadam.com,代码行数:16,代码来源:export.php

示例8: wcli_wxr_site_url

/**
 * Return the URL of the site
 *
 * @since 2.5.0
 *
 * @return string Site URL.
 */
function wcli_wxr_site_url()
{
    // ms: the base url
    if (is_multisite()) {
        return network_home_url();
    } else {
        return get_bloginfo_rss('url');
    }
}
开发者ID:scotto77,项目名称:advanced-custom-fields-wpcli,代码行数:16,代码来源:helpers.php

示例9: wxr_site_url

/**
 * Return the URL of the site
 *
 * @since 2.5.0
 *
 * @return string Site URL.
 */
function wxr_site_url()
{
    // Multisite: the base URL.
    if (is_multisite()) {
        return network_home_url();
    } else {
        return get_bloginfo_rss('url');
    }
}
开发者ID:enlacee,项目名称:anb.platicom.com.pe,代码行数:16,代码来源:lpr-export-functions.php

示例10: __construct

 /**
  * The Constructor function adds the function that pushes published posts to the list, as well as registers the widget.
  */
 function __construct()
 {
     load_plugin_textdomain('hrpn', false, dirname(plugin_basename(__FILE__)) . '/languages');
     add_action('publish_post', array($this, 'Add_Post_To_H1_Recent_Posts_From_Network'));
     add_action('widgets_init', array($this, 'Register_H1_Recent_Posts_From_Network_Widget'));
     $first_post = get_site_option('first_post');
     $first_post = str_replace("SITE_URL", esc_url(network_home_url()), $first_post);
     $first_post = str_replace("SITE_NAME", get_current_site()->site_name, $first_post);
     $this->first_post = $first_post;
 }
开发者ID:ZeelandFamily,项目名称:h1-recent-posts-from-network,代码行数:13,代码来源:HerculesRecentPostsfromNetwork.php

示例11: __construct

 /**
  * @param Delicious_Brains_API_Plugin $plugin
  */
 function __construct(Delicious_Brains_API_Plugin $plugin)
 {
     $this->plugin = $plugin;
     $home_url = home_url('', 'http');
     if ($this->plugin->is_network_activated) {
         // Make sure always use the network URL in API communication
         $home_url = network_home_url('', 'http');
     }
     $this->home_url = untrailingslashit($home_url);
     parent::__construct();
 }
开发者ID:rlgod,项目名称:danielparker.com.au-wordpress,代码行数:14,代码来源:base.php

示例12: get_absolute_file_url

function get_absolute_file_url($url)
{
    if (is_multisite()) {
        global $blog_id;
        $upload_dir = wp_upload_dir();
        if (strpos($upload_dir['basedir'], 'blogs.dir') !== false) {
            $parts = explode('/files/', $url);
            $url = network_home_url() . '/wp-content/blogs.dir/' . $blog_id . '/files/' . $parts[1];
        }
    }
    return $url;
}
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:12,代码来源:theme-functions.php

示例13: edd_w3edge_w3tc_reset_rooturi

function edd_w3edge_w3tc_reset_rooturi($license, $version)
{
    // data to send in our API request
    $api_params = array('edd_action' => 'reset_rooturi', 'license_key' => $license, 'home_url' => network_home_url(), 'item_name' => urlencode(EDD_W3EDGE_W3TC_NAME), 'r' => rand(), 'version' => $version);
    // Call the custom API.
    $response = wp_remote_get(add_query_arg($api_params, EDD_W3EDGE_STORE_URL), array('timeout' => 15, 'sslverify' => false));
    if (is_wp_error($response)) {
        return false;
    }
    // decode the license data
    $status = json_decode(wp_remote_retrieve_body($response));
    return $status;
}
开发者ID:getupcloud,项目名称:wordpress-ex,代码行数:13,代码来源:integration.php

示例14: get_blogaddress_by_name

function get_blogaddress_by_name( $blogname ) {
	global $current_site;

	if ( is_subdomain_install() ) {
		if ( $blogname == 'main' )
			$blogname = 'www';
		$url = rtrim( network_home_url(), '/' );
		if ( !empty( $blogname ) )
			$url = preg_replace( '|^([^\.]+://)|', '$1' . $blogname . '.', $url );
	} else {
		$url = network_home_url( $blogname );
	}
	return esc_url( $url . '/' );
}
开发者ID:realfluid,项目名称:umbaugh,代码行数:14,代码来源:ms-blogs.php

示例15: get_blogaddress_by_name

/**
 * Get a full blog URL, given a blog name.
 *
 * @since MU
 *
 * @param string $blogname The (subdomain or directory) name
 * @return string
 */
function get_blogaddress_by_name($blogname)
{
    if (is_subdomain_install()) {
        if ($blogname == 'main') {
            $blogname = 'www';
        }
        $url = rtrim(network_home_url(), '/');
        if (!empty($blogname)) {
            $url = preg_replace('|^([^\\.]+://)|', "\${1}" . $blogname . '.', $url);
        }
    } else {
        $url = network_home_url($blogname);
    }
    return esc_url($url . '/');
}
开发者ID:trinoamez,项目名称:WordpressPlatzi,代码行数:23,代码来源:ms-blogs.php


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