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
檢視更多 >