Removes hentry class from the array of post classes#860
Removes hentry class from the array of post classes#860davidakennedy wants to merge 5 commits intoAutomattic:masterfrom
Conversation
* Currently, having the class on pages is not correct use of `hentry`. * `hentry` requires more properties than pages typically have. * Core is not likely to remove class because of backward compatibility. * See: https://core.trac.wordpress.org/ticket/28482 and http://microformats.org/wiki/hentry Fixes Automattic#844
|
Shouldn't the case be if type is 'post' so it doesn't automatically end up on custom post types? |
|
If the CPT is syndicated it should continue having it. |
|
@davidakennedy Could we add a blank line between the short and long description of the function and make "See" a "@see"? |
* Fix description based on feedback. * Also, change `.hentry` styles in theme to use `.post` and `.page` instead.
|
@obenland Adjusted the description based on your feedback. Also, edited the CSS since we have one spot where we use
@dshanske I actually started going this route, but went with page instead because we don't know how authors want to use their post types. I think they need to be able to make the call of whether or not they're syndicated, and we shouldn't get in the way. |
|
This patch works for me. I vote we merge it. |
|
I wonder if we should check for if the current post type has archive enabled, as a way to find out if it's a syndicated post type. Just as a heads up, this change will break compatibility with whatever relies on that class being there all the time. And since this is core output we will forever carry that "incompatibility" layer, opposed to when we add a shiv to make up for something missing in core. |
|
As someone who spent a lot of time trying to figure out this issue, I don't know if there is any other way. I think something like a starter theme should be pushing things forward. |
|
@obenland Maybe something could be done with |
|
I have this in ticket #30783 |
|
It seems in the open core ticket, there was a suggestion that theme options were somehow undesirable |
|
How do we finally decide about merging this? |
|
Maybe add a setting in the Theme Customizer under "Theme Options>Advanced" or some similar panel? "Re-enable Or something similar. Bonus points: we get to show how to add settings to the Theme Customizer. |
|
Core has closed the ticket to address this in Core due backcompat. I would consider that a declaration this is a theme issue, not a Core issue. |
|
I'd be in favor of merging this, especially since Core is not going to do anything with regards to Microformats 2. Plus, Core can't really fix this issue because of breaking current themes and plugins. So it's up to themes to correct the issue and educate.
@obenland Do you mean if a custom post type has |
|
Think I should reopen a PR on adding Microformats 2 to _s? |
|
Pretty much fully in agreement with @davidakennedy about merging. |
|
@davidakennedy Do you think you could update this PR`? We could remove the class from all of post types that are not hierarchical. if ( ! is_post_type_hierarchical( get_post_type() ) {
$classes = array_diff( $classes, array( 'hentry' ) );
}As this will be only added on new themes it is like we are breaking backwards compatibility. If there are any compatibility issues between new themes and plugins then that will show up a place for improvement in the plugin. |
|
@grappler I refreshed the PR, but kept the existing code. I'm confused because I do think it would be ideal if this could be applied to all post types that don't need this class. Also, happy to squash commits once we figure out the best path. |
|
@davidakennedy I have been thinking about this a bit more. Sorry But on the other hand it depends on what the theme outputs in the markup. If a theme has One idea would be to remove it for all post types except posts. Depending on what plugins the themes supports it can make some changes. It maybe an idea to add a standard filter that all plugins could use. We might want to look at see how it affects the Post Types in Jetpack. Another idea would be to use My suggestion is till we can answer these questions we should make the changes to the CSS and then create a separate PR to decide when the |
|
@grappler This definitely is tricky.
I agree. I'll open a separate issue for this. This certainly seems complex. 😄 I'm wondering if we only deal with the post types we know about, the default ones in WordPress. Then explain why we did what we did in the code comment, and provide recommendations depending on what a post type does. I'd rather do that than take guesses or have to add a lot of complexity to a starter theme. Is there a way we could advance best practices without having to code for every situation? Because that seems hard here thanks to all the variables. |
|
Just a note, came here through a discussion on the WP Slack, and agree with what was said there: JSON-LD has the future, hentry is hard, so it should be removed from core. Have created a ticket for that in core: |
|
Closing in favor of the path outlined in #1268. |
hentry.hentryrequires more properties than pages typically have.Fixes #844