wp_user_request_action_description

函数
wp_user_request_action_description ( $action_name )
参数
  • (string) $action_name Action name of the request.
    Required:
返回值
  • (string) Human readable action name.
定义位置
相关方法
wp_get_extension_error_descriptionwp_get_user_request_datawp_sidebar_description_wp_privacy_requests_screen_optionsthe_author_description
引入
4.9.6
弃用
-

wp_user_request_action_description是一个WordPress的函数,用来获取一个用户请求动作的人可读描述: 这个函数与GDPR和CCPA一起使用,以帮助网站管理员了解可以执行的不同的用户请求动作: 该函数将一个请求动作作为其输入,并返回一个描述该动作的字符串。

从名称中获取动作描述并返回一个字符串。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_user_request_action_description( $action_name ) {
switch ( $action_name ) {
case 'export_personal_data':
$description = __( 'Export Personal Data' );
break;
case 'remove_personal_data':
$description = __( 'Erase Personal Data' );
break;
default:
/* translators: %s: Action name. */
$description = sprintf( __( 'Confirm the "%s" action' ), $action_name );
break;
}
/**
* Filters the user action description.
*
* @since 4.9.6
*
* @param string $description The default description.
* @param string $action_name The name of the request.
*/
return apply_filters( 'user_request_action_description', $description, $action_name );
}
function wp_user_request_action_description( $action_name ) { switch ( $action_name ) { case 'export_personal_data': $description = __( 'Export Personal Data' ); break; case 'remove_personal_data': $description = __( 'Erase Personal Data' ); break; default: /* translators: %s: Action name. */ $description = sprintf( __( 'Confirm the "%s" action' ), $action_name ); break; } /** * Filters the user action description. * * @since 4.9.6 * * @param string $description The default description. * @param string $action_name The name of the request. */ return apply_filters( 'user_request_action_description', $description, $action_name ); }
function wp_user_request_action_description( $action_name ) {
	switch ( $action_name ) {
		case 'export_personal_data':
			$description = __( 'Export Personal Data' );
			break;
		case 'remove_personal_data':
			$description = __( 'Erase Personal Data' );
			break;
		default:
			/* translators: %s: Action name. */
			$description = sprintf( __( 'Confirm the "%s" action' ), $action_name );
			break;
	}

	/**
	 * Filters the user action description.
	 *
	 * @since 4.9.6
	 *
	 * @param string $description The default description.
	 * @param string $action_name The name of the request.
	 */
	return apply_filters( 'user_request_action_description', $description, $action_name );
}

常见问题

FAQs
查看更多 >