首页 WordPress函数大全 get_post_types()

get_post_types()

2020-05-01 / 4912阅 / 悠然

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

get_post_types( array|string $args = array(), string $output = 'names', string $operator = 'and' )

Get a list of all registered post type objects.

描述

See also See also

  • register_post_type(): for accepted arguments.

Top ↑

参数

$args

(array|string)
(Optional)
An array of key => value arguments to match against the post type objects.

Default value: array()

$output

(string)
(Optional)
The type of output to return. Accepts post type 'names' or 'objects'.

Default value: 'names'

$operator

(string)
(Optional)
The logical operation to perform. 'or' means>Default value: 'and'

返回

(string[]|WP_Post_Type[]) An array of post type names or objects.

大家谈论
    我的见解