Make WordPress Core

Opened 18 years ago

Closed 16 years ago

#8466 closed enhancement (fixed)

Can a "Sticky" view be added to the Edit Posts page next to Drafts?

Reported by: designsimply Owned by: nacin
Priority: low Milestone: 3.1
Component: UI Version: 2.7
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

Can a "Sticky" view be added to the Edit Posts page next to Drafts? See ​http://img.skitch.com/20081202-8qxrw7xxfcjp8m7mq664me993p.jpg

Attachments (3)

8466.diff​ (3.9 KB ) - added by nacin 16 years ago.
8466.png​ (41.7 KB ) - added by nacin 16 years ago.
8466.2.diff​ (4.4 KB ) - added by nacin 16 years ago.
Patch refreshed against [15742].

Download all attachments as: .zip

Change History (17)

#1 @janeforshort
18 years ago

Would only appear when there are sticky posts, not when there are 0. Sticky should also be a label on post title in list, as with password-protected and private.

#2 @westi
18 years ago

  • Cc westi added

Very good idea.

Is this necessary for 2.7 as we need to freeze the strings to ensure the translators have an easy job getting it all done in time (I know this _may_ reuse other strings)

Can it wait for 2.8 / 2.7.1?

#3 @ryan
18 years ago

  • Milestone 2.7 → 2.8

I like the idea too, but it can wait.

#4 @mrmist
18 years ago

Taking a quick look at this it would seem that it would be a whole load easier if sticky_post was a status. Unfortunately that would break loads of other stuff I suspect.

Otherwise (at least with my level of understanding) the generation code for the post counts bar on the edit screen, and the filtering of the list to the different sections becomes a hacky mish-mash of the foreach loop that's there now, and a seperate piece of code that would count up stickies.

#5 follow-up: @janeforshort
18 years ago

Since this ticket was started, Ryan has created a status for Sticky, which now shows up as black text to the right of title on the list screen (just like Private, Draft, etc), so hopefully this should be easier now?

#6 in reply to: ↑ 5 @mrmist
18 years ago

Replying to janeforshort:

Since this ticket was started, Ryan has created a status for Sticky, which now shows up as black text to the right of title on the list screen (just like Private, Draft, etc), so hopefully this should be easier now?

Potentially yes, but until sticky is set as a post_type in wp_posts then the wp_count_posts query will ignore them. My knowledge is not yet up to modifying that to include stuff that is set is_sticky.

#7 @Denis-de-Bernardy
17 years ago

  • Keywords needs-patch added; sticky removed
  • Milestone 2.8 → Future Release
  • Version → 2.7

#8 @mrmist
16 years ago

This is probably possible by using a filter on the manage_posts_columns now somehow?

#9 @nacin
16 years ago

  • Owner set to nacin
  • Status new → reviewing

@nacin
16 years ago

#10 @nacin
16 years ago

  • Keywords has-patch added; needs-patch removed

8466.diff:

  • Adds a "Sticky (#)" link to the edit posts screen.
  • This link appears immediately after "Published (#)" if present, otherwise right after "All (#)".
  • Moves wp() calls in the admin to query_posts(). Per discussion late in the 3.0 cycle, but needs to be double-checked.

@nacin
16 years ago

#11 @mrmist
16 years ago

Patch seems ok to me, tested sticky posts with different status (pending, draft etc..) all showed up ok in the view.

#12 @nacin
16 years ago

  • Milestone Future Release → 3.1
  • Status reviewing → accepted

Related: #12702, sticky posts for custom post types.

@nacin
16 years ago

Patch refreshed against [15742].

#13 @westi
16 years ago

Patch looks ok.

Should use wp() still as that merges the query string in the url with the extra query arguments.

Looks like we should add post__in and post__not__in to the private query vars in the WP class

#14 @nacin
16 years ago

  • Resolution → fixed
  • Status accepted → closed

(In [16003]) Add a 'Sticky' filter on the edit posts page. Add post_in and post_not_in as private query vars in the WP class to support this. fixes #8466.

Note: See TracTickets for help on using tickets.