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


PHP wp_explain_nonce函数代码示例

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


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

示例1: wp_nonce_ays

/**
 * Display "Are You Sure" message to confirm the action being taken.
 *
 * If the action has the nonce explain message, then it will be displayed along
 * with the "Are you sure?" message.
 *
 * @package WordPress
 * @subpackage Security
 * @since 2.0.4
 *
 * @param string $action The nonce action.
 */
function wp_nonce_ays($action)
{
    $title = __('WordPress Failure Notice');
    $html = wp_specialchars(wp_explain_nonce($action));
    if (wp_get_referer()) {
        $html .= "</p><p><a href='" . remove_query_arg('updated', clean_url(wp_get_referer())) . "'>" . __('Please try again.') . "</a>";
    } elseif ('log-out' == $action) {
        $html .= "</p><p>" . sprintf(__("Do you really want to <a href='%s'>log out</a>?"), wp_nonce_url(site_url('wp-login.php?action=logout', 'login'), 'log-out'));
    }
    wp_die($html, $title);
}
开发者ID:joelglennwright,项目名称:agencypress,代码行数:23,代码来源:functions.php

示例2: wp_nonce_ays

/**
 * Display "Are You Sure" message to confirm the action being taken.
 *
 * If the action has the nonce explain message, then it will be displayed along
 * with the "Are you sure?" message.
 *
 * @package WordPress
 * @subpackage Security
 * @since 2.0.4
 *
 * @param string $action The nonce action.
 */
function wp_nonce_ays($action)
{
    $title = __('WordPress Failure Notice');
    $html = esc_html(wp_explain_nonce($action));
    if ('log-out' == $action) {
        $html .= "</p><p>" . sprintf(__("Do you really want to <a href='%s'>log out</a>?"), wp_logout_url());
    } elseif (wp_get_referer()) {
        $html .= "</p><p><a href='" . esc_url(remove_query_arg('updated', wp_get_referer())) . "'>" . __('Please try again.') . "</a>";
    }
    wp_die($html, $title, array('response' => 403));
}
开发者ID:Ogwang,项目名称:sainp,代码行数:23,代码来源:functions.php

示例3: wp_nonce_ays

function wp_nonce_ays($action)
{
    $title = __('WordPress Failure Notice');
    $html = wp_specialchars(wp_explain_nonce($action)) . '</p>';
    if (wp_get_referer()) {
        $html .= "<p><a href='" . remove_query_arg('updated', clean_url(wp_get_referer())) . "'>" . __('Please try again.') . "</a>";
    }
    wp_die($html, $title);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:9,代码来源:functions.php

示例4: wp_nonce_ays

function wp_nonce_ays($action) {
	global $pagenow, $menu, $submenu, $parent_file, $submenu_file;

	$adminurl = get_option('siteurl') . '/wp-admin';
	if ( wp_get_referer() )
		$adminurl = clean_url(wp_get_referer());

	$title = __('WordPress Confirmation');
	// Remove extra layer of slashes.
	$_POST   = stripslashes_deep($_POST  );
	if ( $_POST ) {
		$q = http_build_query($_POST);
		$q = explode( ini_get('arg_separator.output'), $q);
		$html .= "\t<form method='post' action='" . attribute_escape($pagenow) . "'>\n";
		foreach ( (array) $q as $a ) {
			$v = substr(strstr($a, '='), 1);
			$k = substr($a, 0, -(strlen($v)+1));
			$html .= "\t\t<input type='hidden' name='" . attribute_escape(urldecode($k)) . "' value='" . attribute_escape(urldecode($v)) . "' />\n";
		}
		$html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n";
		$html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n";
	} else {
		$html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . clean_url(add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] )) . "'>" . __('Yes') . "</a></p>\n\t</div>\n";
	}
	$html .= "</body>\n</html>";
	wp_die($html, $title);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:27,代码来源:functions.php

示例5: explain_nonce

 private function explain_nonce($action)
 {
     global $Ktai_Style;
     remove_filter('the_title', array($Ktai_Style->shrinkage, 'shrink_title'), 90);
     if ($action === -1 || !preg_match('/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches)) {
         return;
     }
     $verb = $matches[1];
     $noun = $matches[2];
     $trans = array();
     $trans['change']['cats'] = array(__('Are you sure you want to change categories of this post: &quot;%s&quot;?', 'ktai_style'), 'get_the_title');
     $trans['unapprove']['comment'] = array(__('Are you sure you want to unapprove the comment: &quot;%s&quot;?', 'ktai_style'), 'use_id');
     $trans['approve']['comment'] = array(__('Are you sure you want to approve the comment: &quot;%s&quot;?', 'ktai_style'), 'use_id');
     $trans['delete']['comment'] = array(__('Are you sure you want to delete the comment: &quot;%s&quot;?', 'ktai_style'), 'use_id');
     $trans['delete']['post'] = array(__('Are you sure you want to delete this post: &quot;%s&quot;?', 'ktai_style'), 'get_the_title');
     $trans['delete']['page'] = array(__('Are you sure you want to delete this page: &quot;%s&quot;?', 'ktai_style'), 'get_the_title');
     $trans['bulk']['spamdelete'] = array(__('Are you sure you want to delete all spam?', 'ktai_style'));
     if (isset($trans[$verb][$noun])) {
         if (!empty($trans[$verb][$noun][1])) {
             $lookup = $trans[$verb][$noun][1];
             $object = $matches[4];
             if ('use_id' != $lookup) {
                 $object = call_user_func($lookup, $object);
             }
             $desc = sprintf($trans[$verb][$noun][0], $object);
         } else {
             $desc = $trans[$verb][$noun][0];
         }
         $allow_proceed = true;
     } else {
         $desc = wp_explain_nonce($action);
         $allow_proceed = false;
     }
     return array($desc, $allow_proceed);
 }
开发者ID:masayukiando,项目名称:wordpress-event-search,代码行数:35,代码来源:class.php

示例6: wp_nonce_ays

function wp_nonce_ays($action)
{
    global $pagenow;
    $title = __('WordPress Failure Notice');
    $html .= "\t<div id='message' class='updated fade'>\n\t<p>" . wp_specialchars(wp_explain_nonce($action)) . "</p>\n\t<p>";
    if (wp_get_referer()) {
        $html .= "<a href='" . remove_query_arg('updated', clean_url(wp_get_referer())) . "'>" . __('Please try again.') . "</a>";
    }
    $html .= "</p>\n\t</div>\n";
    $html .= "</body>\n</html>";
    wp_die($html, $title);
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:12,代码来源:functions.php


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