Make WordPress Core

Opened 14 years ago

Closed 14 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
Priority: normal Milestone: 3.5
Component: General Version: 3.5
Severity: normal Keywords: has-patch needs-unit-tests commit
Cc: Focuses:

Description

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

Download all attachments as: .zip

Change History (15)

#1 @itworx
14 years ago

  • Keywords dev-feedback added

#2 @itworx
14 years ago

  • Keywords dev-feedback removed

#3 @c3mdigital
14 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' );

get_theme_support( 'post-formats' );
returns the correct array of post formats.

get_post_format() always returns false on page or custom post types.

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

Last edited 14 years ago by c3mdigital (previous) (diff)

#4 @SergeyBiryukov
14 years ago

  • Milestone Awaiting Review3.5

Broken in [21981], which added ! is_object_in_taxonomy() check to get_the_terms():
http://core.trac.wordpress.org/browser/trunk/wp-includes/category-template.php?rev=22412#L1065

#5 @SergeyBiryukov
14 years ago

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

22473.patch reverts a part of [21981].

#7 @nacin
14 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
14 years ago

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

22473.2.patch fixes that.

#9 @nacin
14 years ago

  • Owner set to ryan
  • Status newassigned

#10 @nacin
14 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
14 years ago

  • Keywords commit added

#13 @ryan
14 years ago

  • Resolutionfixed
  • Status assignedclosed

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.