WordPress开发者和主题制作者的搜索引擎



wp_get_user_request_data ›

Since4.9.6
已弃用n/a
wp_get_user_request_data ( $request_id )
参数:
  • (int) $request_id Request ID to get data about.
    Required: Yes
返回:
  • (WP_User_Request|false)
定义在:
文档:

Return data about a user request.



源码

function wp_get_user_request_data( $request_id ) {
	$request_id = absint( $request_id );
	$post       = get_post( $request_id );

	if ( ! $post || 'user_request' !== $post->post_type ) {
		return false;
	}

	return new WP_User_Request( $post );
}