Make WordPress Core

Opened 6 years ago

Last modified 5 years ago

#47041 new defect (bug)

Custom Post type author empty

Reported by: dipeshkakadiya's profile dipesh.kakadiya Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.1.1
Component: Posts, Post Types Keywords:
Focuses: rest-api Cc:

Description

If I created Custom post type with rest enabled [ for Gutenberg support ] and I try to created/publish custom post type then Post author is empty instead of the current user

I checked with bbPress Post type forum, For enabled rest support, refer the following code

function twentyseventeen_rest_support_bbpress() {
        global $wp_post_types;
        $forum_post_type = bbp_get_forum_post_type();
        if (isset($wp_post_types[$forum_post_type])) {
               $wp_post_types[ $forum_post_type ]->show_in_rest = true;
        }
}
add_action('init', 'twentyseventeen_rest_support_bbpress', 25);

Change History (2)

#1 @SergeyBiryukov
6 years ago

  • Focuses rest-api added

#2 @talldanwp
5 years ago

There's a matching issue that was created in the Gutenberg repo:
https://github.com/WordPress/gutenberg/issues/17073

I've closed that in favor of this ticket since the logic for setting the author seems to be handled in core (Gutenberg sends no author data).

Note: See TracTickets for help on using tickets.