Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#22473 closed defect (bug) (fixed)

Post-formats radiogroup on custom post types and pages will not update in 3.5 Beta 3

Reported by: itworx Owned by: ryan
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.5
Component: General Keywords: has-patch needs-unit-tests commit
Focuses: Cc:


The post-formats are being saved, but the radiogroup will not show selected format after publishing, but stays checked at Standard post-format.

Works only on posts.

Attachments (2)

22473.patch (1.3 KB) - added by SergeyBiryukov 3 years ago.
22473.2.patch (1.3 KB) - added by SergeyBiryukov 3 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 @itworx3 years ago

  • Keywords dev-feedback added

comment:2 @itworx3 years ago

  • Keywords dev-feedback removed

comment:3 @c3mdigital3 years ago

  • Keywords needs-patch added

I can confirm this.

Enable post format support and add for pages.

add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
add_post_type_support( 'page', 'post-formats' );

Create new page and change post format from normal and publish or save draft. On refresh the checked value goes back to normal.

Version 0, edited 3 years ago by c3mdigital (next)

comment:4 @SergeyBiryukov3 years ago

  • Milestone changed from Awaiting Review to 3.5

Broken in [21981], which added ! is_object_in_taxonomy() check to get_the_terms():

@SergeyBiryukov3 years ago

comment:5 @SergeyBiryukov3 years ago

  • Keywords has-patch needs-unit-tests added; needs-patch removed

22473.patch reverts a part of [21981].

comment:7 @nacin3 years ago

I was under the impression that register_taxonomy_for_object_type() was also necessary for proper post format support with custom post types. I mentioned in #20438 (which Sergey linked to, thanks) that we decided that back in 3.1.

Of course, if something that happened to work previously now works, we should fix.

@SergeyBiryukov3 years ago

comment:8 @SergeyBiryukov3 years ago

22473.patch caused a warning in wp_list_pluck() after saving changes in Quick Edit.

22473.2.patch fixes that.

comment:9 @nacin3 years ago

  • Owner set to ryan
  • Status changed from new to assigned

comment:10 @nacin3 years ago

Yeah, 22473.2.patch looks good to me. get_the_terms() is too much of a generic-use function for us to get away with a formal taxonomy check.

comment:11 @nacin3 years ago

  • Keywords commit added

comment:13 @ryan3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 22722:

Don't bail from get_the_terms() if the post type is not registed for the taxonomy. This can break back compat when add_post_type_support( 'page', 'post-formats' ) is called but register_taxonomy_for_object_type( 'postr_-format', 'page' ) is not.

Props SergeyBiryukov
fixes #22473

Note: See TracTickets for help on using tickets.