在WordPress中的REST API中扩展发布对象

时间:2018-10-09 13:35:59

标签: wordpress wordpress-rest-api

我们进行了一个自定义的REST api调用,该调用执行get_posts。 该调用返回

WP_Post Object
(
    [ID] =>
    [post_author] =>
    [post_date] => 
    [post_date_gmt] => 
    [post_content] => 
    [post_title] => 
    [post_excerpt] => 
    [post_status] =>
    [comment_status] =>
    [ping_status] => 
    [post_password] => 
    [post_name] =>
    [to_ping] => 
    [pinged] => 
    [post_modified] => 
    [post_modified_gmt] =>
    [post_content_filtered] => 
    [post_parent] => 
    [guid] => 
    [menu_order] =>
    [post_type] =>
    [post_mime_type] => 
    [comment_count] =>
    [filter] =>
)

我想返回与wp-json / wp / v2 / post?_embed相同的模式-带有类别,图像等。该怎么办?

0 个答案:

没有答案