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

PHP get_site_url函数代码示例

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

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



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

示例1: send_form_feedback

function send_form_feedback()
{
    if ($_POST) {
        // Set wp_mail html content type
        add_filter('wp_mail_content_type', 'set_html_content_type');
        $name = isset($_POST['name']) ? $_POST['name'] : '';
        $email = isset($_POST['email']) ? $_POST['email'] : '';
        $phone = isset($_POST['phone']) ? $_POST['phone'] : '';
        $message = isset($_POST['message']) ? $_POST['message'] : '';
        $to = get_option('admin_email');
        $subject = 'Новое сообщение';
        $content = '<p><b>Имя:</b> ' . $name . '</p>';
        $content .= '<p><b>E-mail:</b> ' . $email . '</p>';
        $content .= '<p><b>Телефон:</b> ' . $phone . '</p>';
        $content .= '<p><b>Сообщение:</b></p>';
        $content .= '<p>' . $message . '</p>';
        $content .= '<br /><br />';
        $content .= 'Это сообщение отправлено с сайта <a href="' . get_site_url() . '">' . get_site_url() . '</a>';
        if (wp_mail($to, $subject, $content)) {
            $json = array('status' => 'success', 'message' => '<b>Поздравляем!</b><br />Сообщение успешно отправлено');
        } else {
            $json = array('status' => 'error', 'message' => '<b>Ошибка!</b><br />Попробуйте позже или свяжитесь с администрацией сайта');
        }
        // Reset wp_mail html content type
        remove_filter('wp_mail_content_type', 'set_html_content_type');
        die(json_encode($json));
    }
    die(json_encode(array('status' => 'error', 'message' => '<b>Что-то пошло не так!</b><br />Попробуйте позже или свяжитесь с администрацией сайта')));
}
开发者ID:antarx,项目名称:wp-blank,代码行数:29,代码来源:functions.php


示例2: update_plugins

	/**
	 * Update WordPress plugin list page.
	 *
	 * @param  object $transient
	 * @return object
	 */
	public static function update_plugins( $transient ) {
		$extensions = Ai1wm_Extensions::get();

		// Get current updates
		$updates = get_option( AI1WM_UPDATER, array() );

		// Get extension updates
		foreach ( $updates as $slug => $update ) {
			if ( isset( $extensions[ $slug ]) && ( $extension = $extensions[ $slug ] ) ) {
				if ( get_option( $extension['key'] ) ) {
					if ( version_compare( $extension['version'], $update['version'], '<' ) ) {

						// Get Site URL
						$url = urlencode( get_site_url() );

						// Get Purchase ID
						$key = get_option( $extension['key'] );

						// Set plugin details
						$transient->response[ $extension['basename'] ] = (object) array(
							'slug'        => $slug,
							'new_version' => $update['version'],
							'url'         => $update['homepage'],
							'plugin'      => $extension['basename'],
							'package'     => sprintf( '%s/%s?siteurl=%s', $update['download_link'], $key, $url ),
						);
					}
				}
			}
		}

		return $transient;
	}
开发者ID:jknowles94,项目名称:Work-examples,代码行数:39,代码来源:class-ai1wm-updater.php


示例3: CheckLoginCookie

function CheckLoginCookie()
{
    global $wpdb, $ewd_feup_user_table_name;
    $LoginTime = get_option("EWD_FEUP_Login_Time");
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $CookieName = "EWD_FEUP_Login" . "%" . sha1(md5(get_site_url() . $Salt));
    $cookie_name_url_encoded = urlencode($CookieName);
    $Cookie = null;
    if (isset($_COOKIE[$CookieName])) {
        $Cookie = $_COOKIE[$CookieName];
    }
    if (isset($_COOKIE[$cookie_name_url_encoded])) {
        $Cookie = $_COOKIE[$cookie_name_url_encoded];
    }
    $Username = substr($Cookie, 0, strpos($Cookie, "%"));
    $TimeStamp = substr($Cookie, strpos($Cookie, "%") + 1, strrpos($Cookie, "%") - strpos($Cookie, "%"));
    $SecCheck = substr($Cookie, strrpos($Cookie, "%") + 1);
    $UserAgent = $_SERVER['HTTP_USER_AGENT'];
    if (isset($_COOKIE[$CookieName]) || isset($_COOKIE[$cookie_name_url_encoded]) and $TimeStamp < time() + $LoginTime * 60) {
        $UserDB = $wpdb->get_row($wpdb->prepare("SELECT User_Sessioncheck , User_Password FROM {$ewd_feup_user_table_name} WHERE Username ='%s'", $Username));
        $DBSeccheck = $UserDB->User_Sessioncheck;
        if (strcmp(sha1($SecCheck . $UserAgent), $DBSeccheck) === 0) {
            $User = array('Username' => $Username, 'User_Password' => $UserDB->User_Password);
            return $User;
        } else {
            return false;
        }
    }
    return false;
}
开发者ID:jeremygeltman,项目名称:ThinkThinly,代码行数:30,代码来源:CheckLoginCookie.php


示例4: avia_menu_item_filter

 function avia_menu_item_filter($item)
 {
     if (isset($item->url) && strpos($item->url, '#DOMAIN') === 0) {
         $item->url = str_replace("#DOMAIN", get_site_url(), $item->url);
     }
     return $item;
 }
开发者ID:erikdukker,项目名称:medisom,代码行数:7,代码来源:functions-enfold.php


示例5: flipping_team_install

/** Setup database and sample data */
function flipping_team_install()
{
    global $wpdb;
    $table_name = $wpdb->prefix . "team";
    if ($wpdb->get_var("SHOW TABLES LIKE '{$table_name}'") != $table_name) {
        $sql = "CREATE TABLE " . $table_name . " (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\ttime bigint(11) DEFAULT '0' NOT NULL,\n\t\t\tname tinytext NOT NULL,\n\t\t\turl VARCHAR(200) NOT NULL,\n\t\t\timageloc VARCHAR(300) NOT NULL,\n\t\t\tinfo text NOT NULL,\n\t\t\tUNIQUE KEY id (id)\n\t\t\t);";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($sql);
        add_option("flipping_team_db_version", $flipping_team_db_version);
        $table_name = $wpdb->prefix . "team";
        $name = "Abhishek Gupta";
        $website = "http://abhishek.cc";
        $info = "Student at IIT Delhi. More about on his website abhishek.cc or his startup zumbl.com .";
        $imageloc = get_site_url() . "/wp-content/plugins/flipping-team/images/images.jpeg";
        $rows_affected = $wpdb->insert($table_name, array('time' => current_time('mysql'), 'name' => $name, 'url' => $website, 'imageloc' => $imageloc, 'info' => $info));
        $table_name = $wpdb->prefix . "team";
        $name = "Scii";
        $website = "http://scil.coop";
        $info = "More about on his website.";
        $imageloc = get_site_url() . "/wp-content/plugins/flipping-team/images/images.jpeg";
        $rows_affected = $wpdb->insert($table_name, array('time' => current_time('mysql'), 'name' => $name, 'url' => $website, 'imageloc' => $imageloc, 'info' => $info));
    }
    $installed_ver = get_option("flipping_team_db_version");
    if ($installed_ver != $jal_db_version) {
        $sql = "CREATE TABLE " . $table_name . " (\n\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\ttime bigint(11) DEFAULT '0' NOT NULL,\n\t\t\tname tinytext NOT NULL,\n\t\t\turl VARCHAR(200) NOT NULL,\n\t\t\timageloc VARCHAR(300) NOT NULL,\n\t\t\tinfo text NOT NULL,\n\t\t\tUNIQUE KEY id (id)\n\t\t\t);";
        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
        dbDelta($sql);
        update_option("flipping_team_db_version", $flipping_team_db_version);
    }
}
开发者ID:joasssko,项目名称:schk,代码行数:31,代码来源:flipping_team.php


示例6: activate

 /**
  *
  */
 public function activate()
 {
     $params = array();
     $params['username'] = vc_post_param('username');
     $params['version'] = WPB_VC_VERSION;
     $params['key'] = vc_post_param('key');
     $params['api_key'] = vc_post_param('api_key');
     $params['url'] = get_site_url();
     $params['ip'] = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : '';
     $params['dkey'] = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 20);
     $string = 'activatelicense?';
     $request_url = self::getWpbControlUrl(array($string, http_build_query($params, '', '&')));
     $response = wp_remote_get($request_url, array('timeout' => 300));
     if (is_wp_error($response)) {
         echo json_encode(array('result' => false));
         die;
     }
     $result = json_decode($response['body']);
     if (!is_object($result)) {
         echo json_encode(array('result' => false));
         die;
     }
     if ((bool) $result->result === true || (int) $result->code === 401 && isset($result->deactivation_key)) {
         $this->setDeactivation(isset($result->code) && (int) $result->code === 401 ? $result->deactivation_key : $params['dkey']);
         vc_settings()->set('envato_username', $params['username']);
         vc_settings()->set('envato_api_key', $params['api_key']);
         vc_settings()->set('js_composer_purchase_code', $params['key']);
         echo json_encode(array('result' => true));
         die;
     }
     echo $response['body'];
     die;
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:36,代码来源:class-vc-license.php


示例7: sf_red_validate

function sf_red_validate($in)
{
    $out = array();
    $url = get_site_url();
    $in = json_decode($in, true);
    if (is_array($in)) {
        for ($i = 0; $i < count($in); $i++) {
            if (is_array($in[$i]) && $in[$i][0]) {
                $tmp = strpos($in[$i][0], substr(strstr($url, '//'), 2));
                if ($tmp !== false) {
                    $in[$i][0] = substr($in[$i][0], $tmp + strlen(strstr($url, '//')) - 2);
                }
                if (substr($in[$i][0], 0, 1) != '/') {
                    $in[$i][0] = '/' . $in[$i][0];
                }
                $tmp = strpos($in[$i][1], '//');
                if ($tmp === false) {
                    $in[$i][1] = $url . (strpos($in[$i][1], '/') === 0 ? '' : '/') . $in[$i][1];
                } else {
                    if ($tmp === 0) {
                        $in[$i][1] = 'http:' . $in[$i][1];
                    }
                }
                if ($in[$i][1] == $url . '/') {
                    $in[$i][1] = $url;
                }
                $out[] = $in[$i];
            }
        }
    }
    return $out;
}
开发者ID:qcstw-dev,项目名称:qcsasia,代码行数:32,代码来源:redirectlist.php


示例8: search

 public function search($query)
 {
     if (function_exists('is_main_query') && !$query->is_main_query()) {
         return $query;
     }
     if (is_search() && !is_admin() && $this->algolia_registry->validCredential && isset($_GET['instant']) === false) {
         if ($this->algolia_registry->instant) {
             $url = get_site_url() . '/?instant=1&s=' . $query->query['s'] . '#q=' . $query->query['s'] . '&page=0&refinements=%5B%5D&numerics_refinements=%7B%7D&index_name=%22' . $this->algolia_registry->index_name . 'all%22';
             header('Location: ' . $url);
             die;
         }
         $algolia_query = get_search_query(false);
         $options = array('hitsPerPage' => $this->algolia_registry->number_by_page, 'page' => get_query_var('paged') ? get_query_var('paged') - 1 : 0);
         $algolia_helper = new \Algolia\Core\AlgoliaHelper($this->algolia_registry->app_id, $this->algolia_registry->search_key, $this->algolia_registry->admin_key);
         $results = $algolia_helper->search($algolia_query, $options, $this->algolia_registry->index_name . 'all');
         foreach ($results['hits'] as $result) {
             $this->ids[] = $result['objectID'];
         }
         $this->num_pages = $results['nbPages'];
         $this->total_result_count = $results['nbHits'];
         $this->page = $results['page'];
         $query->query = array();
         set_query_var('post__in', $this->ids);
         set_query_var('post_type', null);
         set_query_var('s', null);
         set_query_var('paged', null);
         return $query;
     }
     return $query;
 }
开发者ID:PoNote,项目名称:algoliasearch-wordpress,代码行数:30,代码来源:QueryReplacer.php


示例9: wfap_get_access_token

function wfap_get_access_token()
{
    if (isset($_REQUEST['code'])) {
        $code = $_REQUEST['code'];
        $id = get_option('wfap_app_id');
        $sec = get_option('wfap_sec_id');
        $page_url = get_site_url();
        $auth_url = 'https://graph.facebook.com/oauth/access_token?client_id=' . $id . '&client_secret=' . $sec . '&redirect_uri=' . $page_url . '&code=' . $code;
        //echo $auth_url;exit;
        //$accesscode = file_get_contents($auth_url);
        $curl_handle = curl_init();
        curl_setopt($curl_handle, CURLOPT_URL, $auth_url);
        curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
        curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl_handle, CURLOPT_USERAGENT, 'fb_auto');
        $query = curl_exec($curl_handle);
        curl_close($curl_handle);
        $allval = array();
        $token = array();
        $allval = explode("=", $query);
        $token = explode("&", $allval[1]);
        $message = "Thank you for authenticate";
        if ($token != '') {
            update_option('wfap_user_tkn', $token[0]);
        }
        //echo $query;exit;
        $location = admin_url('admin.php?page=wp-facebook-auto-publish/wp-fap-gui.php&msg=' . $message);
        wp_redirect($location);
        exit;
    }
}
开发者ID:tuanlibra,项目名称:thptxuanang,代码行数:31,代码来源:wp-facebook-auto-publish.php


示例10: zero_scripts

 function zero_scripts()
 {
     if (!is_admin()) {
         //Call Modernizr
         wp_register_script('modernizr', get_template_directory_uri() . '/js/libs/modernizr.dev.js', array(), null, false);
         wp_enqueue_script('modernizr');
         //Call JQuery
         wp_deregister_script('jquery');
         wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', '', '', true);
         wp_enqueue_script('jquery');
         if (is_front_page() || is_page_template('new-story-page.php')) {
             wp_register_script('slider_js', get_template_directory_uri() . '/js/libs/slider.min.js', array('jquery'), null, true);
             wp_enqueue_script('slider_js');
         }
         if (is_page(11) || is_child(11)) {
             wp_register_script('gallery_js', get_template_directory_uri() . '/js/libs/gallery.js', array('jquery'), null, true);
             wp_enqueue_script('gallery_js');
         }
         //Call Framework js file
         wp_register_script('main_js', get_template_directory_uri() . '/js/build/concat.js', array('jquery'), '', true);
         wp_enqueue_script('main_js');
     }
     // Setting the site URL as a global variable
     // You can use it to access the template URL in the mainJSfile
     $site_parameters = array('site_url' => get_site_url(), 'theme_directory' => get_template_directory_uri());
     wp_localize_script('main_js', 'SiteParameters', $site_parameters);
 }
开发者ID:zanonnicola,项目名称:code-sample,代码行数:27,代码来源:enqueue_scripts.php


示例11: __construct

 public function __construct($pluginMainFile)
 {
     $this->_wpUrl = get_site_url();
     $this->_wpUrl = $this->makeUniversalLink($this->_wpUrl);
     $this->_wpPluginsUrl = plugins_url('/');
     $this->_wpPluginsUrl = $this->makeUniversalLink($this->_wpPluginsUrl);
     $this->_pluginDirName = plugin_basename(dirname($pluginMainFile)) . '/';
     $this->_pluginMainFile = $pluginMainFile;
     $this->_pluginPath = plugin_dir_path($pluginMainFile);
     $this->_pluginUrl = plugins_url('/', $pluginMainFile);
     $this->_pluginUrl = $this->makeUniversalLink($this->_pluginUrl);
     $this->_pluginCachePath = $this->_pluginPath . 'cache/';
     $this->_pluginCacheUrl = $this->_pluginUrl . 'cache/';
     $this->_pluginStaticPath = $this->_pluginPath . 'static/';
     $this->_pluginStaticUrl = $this->_pluginUrl . 'static/';
     $this->_pluginCssPath = $this->_pluginStaticPath . 'styles/';
     $this->_pluginCssUrl = $this->_pluginStaticUrl . 'styles/';
     $this->_pluginImagesPath = $this->_pluginStaticPath . 'images/';
     $this->_pluginImagesUrl = $this->_pluginStaticUrl . 'images/';
     $this->_pluginJsPath = $this->_pluginStaticPath . 'js/';
     $this->_pluginJsUrl = $this->_pluginStaticUrl . 'js/';
     $this->_pluginTemplatePath = $this->_pluginPath . 'templates/';
     $this->_pluginTemplateUrl = $this->_pluginUrl . 'templates/';
     $this->_pluginLanguagesPath = $this->_pluginDirName . 'languages/';
     $this->onInit();
 }
开发者ID:likelazyeyes,项目名称:woocommerce-multistep-checkout-wizard-lite-moded,代码行数:26,代码来源:FestiPlugin.php


示例12: activity_admin_post_category_check

function activity_admin_post_category_check($post_id, $post, $update)
{
    if (is_admin()) {
        if (is_plugin_active('activity/activity.php')) {
            $post_cat = wp_get_post_categories($post_id);
            if (empty($post_cat)) {
                return;
            } else {
                $activity_cat = intval(get_option('activity_category'));
                $is_post_activity = in_array($activity_cat, $post_cat);
                if ($is_post_activity) {
                    if (strpos($_SERVER['REQUEST_URI'], '/wp-admin/admin.php?page=activity_admin') === false) {
                        $post_cat = array_diff($post_cat, array($activity_cat));
                        if (empty($post_cat)) {
                            $post_cat = array(1);
                        }
                        $post_data = array('ID' => $post_id, 'post_category' => $post_cat);
                        $post_update = wp_update_post($post_data);
                        header('Location: ' . get_site_url() . '/wp-admin/admin.php?page=activity_admin&action=error_add_activity');
                        exit;
                    }
                }
            }
        }
    }
}
开发者ID:chadhao,项目名称:WordPress_Dev,代码行数:26,代码来源:functions.php


示例13: __construct

 public function __construct($parent)
 {
     //Call parent constructor
     parent::__construct($parent);
     //Get the textdomain from the Helper class
     $this->l10n_domain = ACF_Location_Field_Helper::L10N_DOMAIN;
     //Base directory of this field
     $this->base_dir = rtrim(dirname(realpath(__FILE__)), DIRECTORY_SEPARATOR);
     //Build the base relative uri by searching backwards until we encounter the wordpress ABSPATH
     //This may not work if the $base_dir contains a symlink outside of the WordPress ABSPATH
     $root = array_pop(explode(DIRECTORY_SEPARATOR, rtrim(realpath(ABSPATH), DIRECTORY_SEPARATOR)));
     $path_parts = explode(DIRECTORY_SEPARATOR, $this->base_dir);
     $parts = array();
     while ($part = array_pop($path_parts)) {
         if ($part == $root) {
             break;
         }
         array_unshift($parts, $part);
     }
     $this->base_uri_rel = '/' . implode('/', $parts);
     $this->base_uri_abs = get_site_url(null, $this->base_uri_rel);
     // set name / title
     $this->name = 'location-field';
     // variable name (no spaces / special characters / etc)
     $this->title = __('Location', $this->l10n_domain);
     // field label (Displayed in edit screens)
     add_action('admin_print_scripts', array(&$this, 'admin_print_scripts'), 12, 0);
     add_action('admin_print_styles', array(&$this, 'admin_print_styles'), 12, 0);
 }
开发者ID:dyarfi,项目名称:binasenisuara.com,代码行数:29,代码来源:location-field.php


示例14: edd_email_preview_template_tags

/**
 * Email Preview Template Tags
 *
 * @since 1.0
 * @param string $message Email message with template tags
 * @return string $message Fully formatted message
 */
function edd_email_preview_template_tags($message)
{
    $download_list = '<ul>';
    $download_list .= '<li>' . __('Sample Product Title', 'easy-digital-downloads') . '<br />';
    $download_list .= '<div>';
    $download_list .= '<a href="#">' . __('Sample Download File Name', 'easy-digital-downloads') . '</a> - <small>' . __('Optional notes about this download.', 'easy-digital-downloads') . '</small>';
    $download_list .= '</div>';
    $download_list .= '</li>';
    $download_list .= '</ul>';
    $file_urls = esc_html(trailingslashit(get_site_url()) . 'test.zip?test=key&key=123');
    $price = edd_currency_filter(edd_format_amount(10.5));
    $gateway = 'PayPal';
    $receipt_id = strtolower(md5(uniqid()));
    $notes = __('These are some sample notes added to a product.', 'easy-digital-downloads');
    $tax = edd_currency_filter(edd_format_amount(1.0));
    $sub_total = edd_currency_filter(edd_format_amount(9.5));
    $payment_id = rand(1, 100);
    $user = wp_get_current_user();
    $message = str_replace('{download_list}', $download_list, $message);
    $message = str_replace('{file_urls}', $file_urls, $message);
    $message = str_replace('{name}', $user->display_name, $message);
    $message = str_replace('{fullname}', $user->display_name, $message);
    $message = str_replace('{username}', $user->user_login, $message);
    $message = str_replace('{date}', date(get_option('date_format'), current_time('timestamp')), $message);
    $message = str_replace('{subtotal}', $sub_total, $message);
    $message = str_replace('{tax}', $tax, $message);
    $message = str_replace('{price}', $price, $message);
    $message = str_replace('{receipt_id}', $receipt_id, $message);
    $message = str_replace('{payment_method}', $gateway, $message);
    $message = str_replace('{sitename}', get_bloginfo('name'), $message);
    $message = str_replace('{product_notes}', $notes, $message);
    $message = str_replace('{payment_id}', $payment_id, $message);
    $message = str_replace('{receipt_link}', sprintf(__('%1$sView it in your browser.%2$s', 'easy-digital-downloads'), '<a href="' . esc_url(add_query_arg(array('payment_key' => $receipt_id, 'edd_action' => 'view_receipt'), home_url())) . '">', '</a>'), $message);
    return wpautop(apply_filters('edd_email_preview_template_tags', $message));
}
开发者ID:jplhomer,项目名称:Easy-Digital-Downloads,代码行数:42,代码来源:template.php


示例15: get_site_subfolder

function get_site_subfolder()
{
    $url_root = get_site_url_root();
    $site_address = get_site_url();
    $subfolder = str_replace($url_root, '', $site_address);
    return $subfolder;
}
开发者ID:Qclanton,项目名称:Tonelp,代码行数:7,代码来源:functions.php


示例16: test_bp_core_ajax_url

 function test_bp_core_ajax_url()
 {
     $forced = force_ssl_admin();
     // (1) HTTPS off
     force_ssl_admin(false);
     $_SERVER['HTTPS'] = 'off';
     // (1a) Front-end
     $this->go_to('/');
     $this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'http'));
     // (1b) Dashboard
     $this->go_to('/wp-admin');
     $this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'http'));
     // (2) FORCE_SSL_ADMIN
     force_ssl_admin(true);
     // (2a) Front-end
     $this->go_to('/');
     $this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'http'));
     // (2b) Dashboard
     $this->go_to('/wp-admin');
     $this->assertEquals(bp_core_ajax_url(), get_site_url(bp_get_root_blog_id(), '/wp-admin/admin-ajax.php', 'https'));
     force_ssl_admin($forced);
     // (3) Multisite, root blog other than 1
     if (is_multisite()) {
         $original_root_blog = bp_get_root_blog_id();
         $blog_id = $this->factory->blog->create(array('path' => '/path' . rand() . time() . '/'));
         buddypress()->root_blog_id = $blog_id;
         $blog_url = get_blog_option($blog_id, 'siteurl');
         $this->go_to(trailingslashit($blog_url));
         buddypress()->root_blog_id = $original_root_blog;
         $ajax_url = bp_core_ajax_url();
         $this->go_to('/');
         $this->assertEquals($blog_url . '/wp-admin/admin-ajax.php', $ajax_url);
     }
 }
开发者ID:JeroenNouws,项目名称:BuddyPress,代码行数:34,代码来源:url.php


示例17: Insert_Logout

function Insert_Logout($atts)
{
    // Include the required global variables, and create a few new ones
    $Salt = get_option("EWD_FEUP_Hash_Salt");
    $Custom_CSS = get_option("EWD_FEUP_Custom_CSS");
    $CookieName = urlencode("EWD_FEUP_Login" . "%" . sha1(md5(get_site_url() . $Salt)));
    $feup_Label_Successful_Logout_Message = get_option("EWD_FEUP_Label_Successful_Logout_Message");
    if ($feup_Label_Successful_Logout_Message == "") {
        $feup_Label_Successful_Logout_Message = __("You have been successfully logged out.", "EWD_FEUP");
    }
    $ReturnString = "";
    // Get the attributes passed by the shortcode, and store them in new variables for processing
    extract(shortcode_atts(array('no_message' => '', 'redirect_page' => '#', 'no_redirect' => 'No', 'submit_text' => 'Logout'), $atts));
    if ($no_redirect != "Yes" and isset($_COOKIE[$CookieName])) {
        $redirect_page = get_the_permalink();
    }
    setcookie($CookieName, "", time() - 3600, "/");
    $_COOKIE[urldecode($CookieName)] = "";
    if ($redirect_page != "#") {
        FEUPRedirect($redirect_page);
    }
    $ReturnString .= "<style type='text/css'>";
    $ReturnString .= $Custom_CSS;
    $ReturnString .= EWD_FEUP_Add_Modified_Styles();
    $ReturnString .= "<div class='feup-information-div'>";
    $ReturnString .= $feup_Label_Successful_Logout_Message;
    $ReturnString .= "</div>";
    if ($no_message != "Yes") {
        return $ReturnString;
    }
}
开发者ID:otkinsey,项目名称:wp-nsds,代码行数:31,代码来源:Insert_Logout.php


示例18: fix_permalink

 function fix_permalink($url, $post)
 {
     if (is_sp_post_type(get_post_type($post)) && 1 !== get_current_blog_id()) {
         return str_replace(get_site_url() . '/blog', get_site_url(), $url);
     }
     return $url;
 }
开发者ID:kleitz,项目名称:ProSports,代码行数:7,代码来源:prosports-multisite.php


示例19: send_new_login_url

 private function send_new_login_url($url)
 {
     if (ITSEC_Core::doing_data_upgrade()) {
         // Do not send emails when upgrading data. This prevents spamming users with notifications just because the
         // data was ported from an old version to a new version.
         return;
     }
     $message = '<p>' . __('Dear Site Admin,', 'better-wp-security') . "</p>\n";
     /* translators: 1: Site name, 2: Site address, 3: New login address */
     $message .= '<p>' . sprintf(__('The login address for %1$s (<code>%2$s</code>) has changed. The new login address is <code>%3$s</code>. You will be unable to use the old login address.', 'better-wp-security'), get_bloginfo('name'), esc_url(get_site_url()), esc_url($url)) . "</p>\n";
     if (defined('ITSEC_DEBUG') && ITSEC_DEBUG === true) {
         $message .= '<p>Debug info (source page): ' . esc_url($_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]) . "</p>\n";
     }
     $message = "<html>\n{$message}</html>\n";
     //Setup the remainder of the email
     $recipients = ITSEC_Modules::get_setting('global', 'notification_email');
     $subject = sprintf(__('[%1$s] WordPress Login Address Changed', 'better-wp-security'), get_site_url());
     $subject = apply_filters('itsec_lockout_email_subject', $subject);
     $headers = 'From: ' . get_bloginfo('name') . ' <' . get_option('admin_email') . '>' . "\r\n";
     //Use HTML Content type
     add_filter('wp_mail_content_type', array($this, 'get_html_content_type'));
     //Send emails to all recipients
     foreach ($recipients as $recipient) {
         $recipient = trim($recipient);
         if (is_email($recipient)) {
             wp_mail($recipient, $subject, $message, $headers);
         }
     }
     //Remove HTML Content type
     remove_filter('wp_mail_content_type', array($this, 'get_html_content_type'));
 }
开发者ID:Garth619,项目名称:Femi9,代码行数:31,代码来源:validator.php


示例20: load

 public static function load()
 {
     // Populate siteurl for later usage
     self::$siteurl = get_site_url();
     /**
      * Small optimisation:
      * WP_CONTENT_URL is used to move wp-content away from WordPress core
      * If wp-content is moved away wp-content urls are automatically relative
      * And we don't need to do anything
      * Also don't do this if https-domain-alias in in use because overlapping functionality
      */
     if (!defined('HTTPS_DOMAIN_ALIAS_FRONTEND_URL') && defined('WP_CONTENT_URL') && substr(WP_CONTENT_URL, 0, 1) != "/") {
         // Makes post content url relative
         add_filter('image_send_to_editor', array(__CLASS__, 'image_url_filter'), 10, 9);
         add_filter('media_send_to_editor', array(__CLASS__, 'media_url_filter'), 10, 3);
         // Change urls in wp-admin
         add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueue_link_adder_js_fix'), 10, 1);
     }
     // When using feeds like rss the content should have absolute urls
     // These are quite easy to generate afterwards inside html content
     add_filter('the_content_feed', array(__CLASS__, 'content_return_absolute_url_filter'), 10, 1);
     /**
      * Check post content on save for absolute links
      * To activate this you need to filter: add_filter('wpp_make_content_relative',__return_true);
      */
     if (apply_filters('wpp_make_post_content_relative', false)) {
         add_filter('content_save_pre', array(__CLASS__, 'content_url_filter'), 10, 1);
     }
 }
开发者ID:ssaarikangas,项目名称:wp-palvelu-plugin,代码行数:29,代码来源:relative-urls.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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