wp_nonce_ays()
wp_nonce_ays( string $action ) 显示“确定”消息以确认正在执行的操作。 Disp…
wp_nonce_ays( string $action )
显示“确定”消息以确认正在执行的操作。
Display “Are You Sure” message to confirm the action being taken.
显示“确定”消息以确认正在执行的操作。
Display “Are You Sure” message to confirm the action being taken.
目录锚点:#说明#参数#源码
说明(Description)
如果操作有nonce explain消息,那么它将与“您确定吗?”留言。
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $action | (string) | 立即行动。 |
源码(Source)
/**
* 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.
*
* @since 2.0.4
*
* @param string $action The nonce action.
*/
function wp_nonce_ays( $action ) {
if ( 'log-out' == $action ) {
$html = sprintf( __( 'You are attempting to log out of %s' ), get_bloginfo( 'name' ) ) . '';
$redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
$html .= sprintf( __( "Do you really want to log out?"), wp_logout_url( $redirect_to ) );
} else {
$html = __( 'Are you sure you want to do this?' );
if ( wp_get_referer() )
$html .= "" . __( 'Please try again.' ) . "";
}
wp_die( $html, __( 'WordPress Failure Notice' ), 403 );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.0.4 | wp-includes/functions.php | 4 | 2 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。





还没有任何评论,赶紧来占个楼吧!