Make WordPress Core

Opened 17 months ago

Last modified 3 months ago

#22590 new enhancement

get_post_class() do not set 'sticky' class in administration posts table

Reported by: corsonr Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 3.4.2
Component: Posts, Post Types Keywords: has-patch needs-testing
Focuses: ui, administration Cc:

Description (last modified by SergeyBiryukov)

get_post_class() does set a 'sticky' class to sticky post on the frontend but not in the administration. So, there's no way to differentiate a sticky post from another non-sticky post excepted the span element to its right.

Adding something similar to this fix the problem:

	// sticky for Sticky Posts in administration
	if ( is_sticky($post->ID) && is_admin() )
		$classes[] = 'post-sticky';

Attachments (2)

get_post_class.diff (497 bytes) - added by mordauk 17 months ago.
Adds "post-sticky" class for sticky posts in the admin list tables.
22590.diff (517 bytes) - added by netweb 5 months ago.
Use 'status-' prefix rather than 'post-' for consistent admin post_status classes

Download all attachments as: .zip

Change History (10)

comment:1 SergeyBiryukov17 months ago

  • Component changed from Appearance to Administration

comment:2 SergeyBiryukov17 months ago

  • Description modified (diff)

comment:3 DrewAPicture17 months ago

  • Cc xoodrew@… added

This seems like an easy win. I'd say +1, except I wonder if there other existing instances of applying post classes in the admin and if so, what are their use-cases in core?

comment:4 corsonr17 months ago

Here is an simple example i did with this plugin: http://remicorson.com/color-my-posts/

mordauk17 months ago

Adds "post-sticky" class for sticky posts in the admin list tables.

comment:5 corsonr16 months ago

here is another sample of how this can be used, http://codecanyon.net/item/color-my-posts-pro/3653526

comment:6 SergeyBiryukov16 months ago

  • Keywords has-patch added; needs-patch removed

netweb5 months ago

Use 'status-' prefix rather than 'post-' for consistent admin post_status classes

comment:7 helen3 months ago

  • Focuses ui added

Related: #26928

comment:8 nacin3 months ago

  • Component changed from Administration to Posts, Post Types
  • Focuses administration added
Note: See TracTickets for help on using tickets.