本文整理汇总了PHP中get_current_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_current_url函数的具体用法?PHP get_current_url怎么用?PHP get_current_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_current_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: echo_form
function echo_form()
{
echo '<form name="doit" method="post" action="' . get_current_url() . '" />';
echo '<input type="submit" name="verify" value="Run" />';
echo '<input type="submit" name="verify" value="Test" />';
echo '</form>';
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:7,代码来源:add_feed_display_relationship.php
示例2: run
function run()
{
if (!reason_user_has_privs($this->admin_page->user_id, 'view_sensitive_data')) {
echo '<p>Sorry; use of this module is restricted.</p>' . "\n";
return;
}
if (!empty($this->admin_page->request['error_reporting_state'])) {
switch ($this->admin_page->request['error_reporting_state']) {
case 'on':
override_developer_status(true);
break;
case 'off':
override_developer_status(false);
break;
}
}
$status = is_developer();
echo '<form method="post" action="' . htmlspecialchars(get_current_url()) . '">';
if ($status) {
echo '<h3>In-page error reporting is currently ON.</h3>' . "\n";
echo '<input type="submit" value="Turn Error Reporting Off" /><input type="hidden" name="error_reporting_state" value="off" />';
} else {
echo '<h3>In-page error reporting is currently OFF.</h3>' . "\n";
echo '<input type="submit" value="Turn Error Reporting On" /><input type="hidden" name="error_reporting_state" value="on" />';
}
echo '</form>';
echo '<p>Note: changes made via this form only last for the duration of the current session.</p>';
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:28,代码来源:error_visibility.php
示例3: echo_form2
function echo_form2()
{
echo '<p>This phase of the script will <strong>RESET ALL EXISTING RELATIONSHIP SORT ORDER DATA FOR THE minisite_page_to_text_blurb ALLOWABLE RELATIONSHIP</strong> - so do not run it unless ';
echo 'this is what you actually intend to do. If you have never run this script before on this reason instance, you should run it in order to preserve the previous sort order of text blurbs on pages.</p>';
echo '<form name="doit" method="post" action="' . get_current_url() . '" />';
echo '<input type="submit" name="verify2" value="Run" />';
echo '<input type="submit" name="verify2" value="Test" />';
echo '</form>';
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:9,代码来源:text_blurb_reorient.php
示例4: secure_failtoban_validate_login_form
/**
* called to validate WP login form
*/
function secure_failtoban_validate_login_form($args)
{
if (isset($_POST['log']) && isset($_POST['pwd'])) {
if (secure_is_failtoban()) {
header('Location: ' . get_current_url(true));
exit;
}
}
}
开发者ID:studio-montana,项目名称:custom,代码行数:12,代码来源:failtoban.php
示例5: init
function init($args = array())
{
if ($this->params['force_secure'] && HTTPS_AVAILABLE && !on_secure_page()) {
header('Location: ' . get_current_url(securest_available_protocol()));
exit(0);
}
// Check for an existing database connection so we can restore it when we're done
$this->db_conn = get_current_db_connection_name();
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:9,代码来源:arbitrary_include.php
示例6: get_demo_url
function get_demo_url($page, $hash = null)
{
$index = settings('interface_filename');
$req = get_current_url();
if (substr($req, -1) != '/') {
$req = dirname($req);
}
return $req . '/' . $index . '?page=' . $page . (!is_null($hash) ? '#' . $hash : '');
}
开发者ID:atelierspierrot,项目名称:demo-builder,代码行数:9,代码来源:demo-builder-lib.php
示例7: authenticate
public function authenticate()
{
nocache_headers();
$is_allowed = $this->isAllowed();
if (!is_user_logged_in() && !$is_allowed) {
$current_url = get_current_url();
wp_redirect(add_query_arg('redirect_to', urlencode($current_url), $this->settings['logout_redirect']));
exit;
}
}
开发者ID:creativelittledots,项目名称:wp-kit-core,代码行数:10,代码来源:FormAuth.php
示例8: show_navigation
function show_navigation($start_with)
{
start_form("", "get");
if ($start_with > 0) {
echo get_href("<p>Previous", set_var(get_current_url(), "start", max(0, $start_with - SHOW_ITEMS)));
} else {
echo "Previous";
}
echo " ";
echo get_href("Next", set_var(get_current_url(), "start", $start_with + SHOW_ITEMS));
end_form();
}
开发者ID:HuniyaArif,项目名称:mosesdecoder,代码行数:12,代码来源:index.php
示例9: force_login_to_site
function force_login_to_site($redirect_url = NULL, $whitelist = array())
{
// https://github.com/kevinvess/wp-force-login
add_action('init', function () use($redirect_url, $whitelist) {
if (!is_user_logged_in()) {
$url = get_current_url();
if (preg_replace('/\\?.*/', '', $url) != preg_replace('/\\?.*/', '', wp_login_url()) && !in_array($url, $whitelist)) {
wp_safe_redirect(wp_login_url($redirect_url ? $redirect_url : $url), 302);
exit;
}
}
});
}
开发者ID:bjorn-ali-goransson,项目名称:Wordpress-Theme,代码行数:13,代码来源:force_login_to_site.php
示例10: secure_captcha_validate_login_form
/**
* called to validate WP login form
*/
function secure_captcha_validate_login_form($args)
{
if (isset($_POST['log']) && isset($_POST['pwd'])) {
if (!secure_captcha_validate_result(SECURE_CAPTCHA_FIELD . '-login')) {
$redirect_to = "";
if (isset($_REQUEST['redirect_to'])) {
$redirect_to = $_REQUEST['redirect_to'];
}
header('Location: ' . get_current_url() . "?redirect_to=" . urlencode($redirect_to));
exit;
}
}
}
开发者ID:studio-montana,项目名称:custom,代码行数:16,代码来源:captcha.php
示例11: init
public static function init($token = false, $secret = false)
{
if (!$token || !$secret) {
$_SESSION['TwitterRedirect'] = get_current_url();
Controller::redirect('?q=twitter/request_auth');
return false;
} else {
self::$auth_token = $token;
self::$auth_secret = $secret;
self::$started = true;
self::$oauth = OAuth::getInstance('twitter');
return true;
}
}
开发者ID:jrgns,项目名称:backend-php,代码行数:14,代码来源:TwitterAPI.obj.php
示例12: template_redirect
public static function template_redirect()
{
if (!self::is_page()) {
return false;
}
if (theme_cache::is_user_logged_in()) {
$account_navs = apply_filters('account_navs', []);
if (!isset($account_navs[get_query_var('tab')])) {
wp_redirect(add_query_arg('tab', 'dashboard', self::get_url()));
}
} else {
wp_redirect(theme_custom_sign::get_tabs('login', get_current_url())['url']);
die;
}
}
开发者ID:ClayMoreBoy,项目名称:mx,代码行数:15,代码来源:custom-account.php
示例13: init
function init($args = array())
{
parent::init($args);
if (!$this->get_authentication()) {
$extra_params = '';
if (!empty($this->msg_uname)) {
$extra_params .= '&msg_uname=' . $this->msg_uname;
}
if (!empty($this->redir_link_text)) {
$extra_params .= '&redir_link_text=' . $this->redir_link_text;
}
$dest_page = urlencode(get_current_url());
header('Location: ' . REASON_LOGIN_URL . '?dest_page=' . $dest_page . $extra_params);
exit;
}
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:16,代码来源:default_with_auth.php
示例14: private_template_include
/**
* template_include filter (allow to override template hierarchy)
* @return template path
*/
function private_template_include($template)
{
$post_id = get_the_id();
if (is_home()) {
$post_id = get_option('page_for_posts');
}
if (tool_private_is_private_post($post_id) && !is_user_logged_in()) {
$private_template = locate_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . PRIVATE_TOOL_NAME . '/templates/tool-private-template.php');
if (!empty($private_template)) {
$template = $private_template;
} else {
wp_redirect(wp_login_url(get_current_url(true)));
}
}
return $template;
}
开发者ID:studio-montana,项目名称:custom,代码行数:20,代码来源:private.php
示例15: get_queried_page
function get_queried_page($depth = 0)
{
$curr_url = get_current_url();
if ($depth != -1) {
$curr_url = strtok($curr_url, '?');
}
$curr_uri = str_replace(get_bloginfo('url'), '', $curr_url);
if ($depth) {
$curr_uri_ary = array_filter(explode('/', $curr_uri));
$curr_uri = trailingslashit(implode('/', array_splice($curr_uri_ary, 0, $depth)));
}
$page = get_page_by_path($curr_uri);
if ($page) {
return $page;
}
return null;
}
开发者ID:kishandchips,项目名称:thebankcorporate,代码行数:17,代码来源:functions.php
示例16: tool_menu_custom_front_enqueue_scripts_tools
/**
* Enqueue scripts for the front end.
*/
function tool_menu_custom_front_enqueue_scripts_tools($dependencies)
{
/**
* enqueue menu-hightlight javascript file
*/
$js_tool_menu_hightlight = locate_web_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . MENU_TOOL_NAME . '/js/tool-menu-hightlight.js');
if (!empty($js_tool_menu_hightlight)) {
if (is_multisite()) {
$home_url = get_site_url(BLOG_ID_CURRENT_SITE);
$home_minisite_url = get_site_url(get_current_blog_id());
} else {
$home_url = home_url('/');
$home_minisite_url = "";
}
$id_blog_page = get_option('page_for_posts');
if (!empty($id_blog_page) && is_numeric($id_blog_page)) {
$blog_url = get_permalink($id_blog_page);
} else {
$blog_url = "";
}
if (is_single() && get_post_type() == 'post') {
$is_post = "1";
} else {
$is_post = "0";
}
$current_url = get_current_url();
wp_enqueue_script('tool-menu-script-menu-hightlight', $js_tool_menu_hightlight, $dependencies, '1.0', true);
wp_localize_script('tool-menu-script-menu-hightlight', 'ToolMenu', array('current_url' => $current_url, 'home_url' => $home_url, 'home_minisite_url' => $home_minisite_url, 'blog_url' => $blog_url, 'is_post' => $is_post));
}
/**
* enqueue menu-toggle javascript file
*/
$js_tool_menu_toggle = locate_web_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . MENU_TOOL_NAME . '/js/tool-menu-toggle.js');
if (!empty($js_tool_menu_toggle)) {
wp_enqueue_script('tool-menu-script-menu-toggle', $js_tool_menu_toggle, $dependencies, '1.0', true);
}
/**
* enqueue menu-fixed-on-scroll javascript file
*/
$js_tool_menu_fixed_on_scroll = locate_web_ressource(CUSTOM_PLUGIN_TOOLS_FOLDER . MENU_TOOL_NAME . '/js/tool-menu-fixed-on-scroll.js');
if (!empty($js_tool_menu_fixed_on_scroll)) {
wp_enqueue_script('tool-menu-script-fixed-on-scroll', $js_tool_menu_fixed_on_scroll, $dependencies, '1.0', true);
}
}
开发者ID:studio-montana,项目名称:custom,代码行数:47,代码来源:menu.php
示例17: getAddressPackage
public function getAddressPackage()
{
$appId = $this->appId;
//appID
$scope = 'jsapi_address';
//说明获取编辑地址权限
$signType = 'SHA1';
//加密方式为sha1
$timeStamp = time();
//时间戳
$nonceStr = $this->_createNonceStr();
//以下开始进行签名
$url = get_current_url();
$accessToken = get_access_token();
$string = 'accesstoken=' . $accessToken . '&appid=' . $appId . '&noncestr=' . $nonceStr . '×tamp=' . $timeStamp . '&url=' . $url;
$addrSign = SHA1($string);
$addressPage = array('appId' => $appId, 'scope' => $scope, 'signType' => $signType, 'addrSign' => $addrSign, 'timeStamp' => $timeStamp, 'nonceStr' => $nonceStr);
return $addressPage;
}
开发者ID:yunzhiclub,项目名称:wemall,代码行数:19,代码来源:JSSDKController.class.php
示例18: get_canonical_url
/**
* @return string|NULL Canonical url, NULL if current page is canonical
*/
public function get_canonical_url()
{
foreach ($this->modules as $key => $module) {
$this->data[$key]['non_canonical'] = $module->get_noncanonical_request_keys();
$this->data[$key]['all'] = array_keys($module->get_cleanup_rules());
$this->data[$key]['canonical'] = array_diff($this->data[$key]['non_canonical'], $this->data[$key]['all']);
}
$canonicalized_url = NULL;
$non_cans_array = $this->get_non_canonical_url_params();
$curr_url = get_current_url();
$parsed_url = parse_url($curr_url);
$non_cans_array = array_flip($non_cans_array);
$canonicalized_url = $this->strip_non_canonical_url_params($non_cans_array, $parsed_url);
if ($canonicalized_url == get_current_url()) {
return;
} else {
return trim_slashes($canonicalized_url);
}
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:22,代码来源:canonicalizer.php
示例19: ad_rtl
function ad_rtl()
{
function get_current_url()
{
$protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? "https://" : "http://";
$domainName = $_SERVER['HTTP_HOST'];
$currentPath = $_SERVER["REQUEST_URI"];
return $protocol . $domainName . $currentPath;
}
function master_dashboard_url()
{
$master_dash_url = get_site_url('1', '/wp-admin/my-sites.php');
return $master_dash_url;
}
$currentURL = get_current_url();
$url = master_dashboard_url();
if ($currentURL == $url) {
wp_redirect(home_url('/login'));
exit;
}
}
开发者ID:sburns90,项目名称:WP-Access-Denied-Redirect,代码行数:21,代码来源:access-denied-redirect.php
示例20: get_locale_url
function get_locale_url($locale = 'ja')
{
$full_url = get_current_url();
$path = explode('?', $full_url);
if (count($path) > 1) {
$url = array_shift($path) . '?';
$search = implode('', $path);
$queries = explode('&', $search);
foreach ($queries as $i => $query) {
$q = explode('=', $query);
if ($q[0] == 'locale') {
$url .= $q[0] . '=' . $locale;
} else {
$url .= '&' . $query;
}
}
return $url;
} else {
return $path[0] . '?locale=' . $locale;
}
}
开发者ID:hiragiayako,项目名称:Portfolio,代码行数:21,代码来源:common_function.php
注:本文中的get_current_url函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论