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

PHP wp_explain_nonce函数代码示例

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

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wp_ext2type函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_expand_dimensions函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap