首页 WordPress函数大全 get_page_by_title()

get_page_by_title()

2020-05-01 / 4935阅 / 悠然

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

get_page_by_title( string $page_title, string $output = OBJECT, string|array $post_type = 'page' )

Retrieve a page given its title.

描述

If more than>

参数

$page_title

(string)
(Required)
Page title.

$output

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

Default value: OBJECT

$post_type

(string|array)
(Optional)
Post type or array of post types.

Default value: 'page'

返回

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

大家谈论
    我的见解