Make WordPress Core

Opened 9 years ago

Closed 9 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 9 years ago.
22473.2.patch (1.3 KB) - added by SergeyBiryukov 9 years ago.

Download all attachments as: .zip

Change History (15)

#1 @itworx
9 years ago

  • Keywords dev-feedback added

#2 @itworx
9 years ago

  • Keywords dev-feedback removed

#3 @c3mdigital
9 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 9 years ago by c3mdigital (next)

#4 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 3.5

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

#5 @SergeyBiryukov
9 years ago

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

22473.patch reverts a part of [21981].

#7 @nacin
9 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.

#8 @SergeyBiryukov
9 years ago

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

22473.2.patch fixes that.

#9 @nacin
9 years ago

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

#10 @nacin
9 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.

#11 @nacin
9 years ago

  • Keywords commit added

#13 @ryan
9 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.