首页 WordPress函数大全 get_page()

get_page()

2020-05-01 / 4918阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

Warning: This function has been deprecated. Use get_post() instead.

get_page( int|WP_Post $page, string $output = OBJECT, string $filter = 'raw' )

Retrieves page data given a page ID or page object.

描述

Use get_post() instead of get_page().

参数

$page

(int|WP_Post)
(Required)
Page object or page ID. Passed by reference.

$output

(string)
(Optional)
The required return type.>WP_Post object, an associative array, or a numeric array, respectively.

Default value: OBJECT

$filter

(string)
(Optional)
How the return value should be filtered. Accepts 'raw', 'edit', 'db', 'display'.

Default value: 'raw'

返回

(WP_Post|array|null) WP_Post or array on success, null on failure.

大家谈论
    我的见解