WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 3 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
Milestone: 3.1 Priority: low
Severity: normal Version: 2.7
Component: UI Keywords: has-patch
Focuses: Cc:

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 4 years ago.
8466.png (41.7 KB) - added by nacin 4 years ago.
8466.2.diff (4.4 KB) - added by nacin 4 years ago.
Patch refreshed against [15742].

Download all attachments as: .zip

Change History (17)

comment:1 janeforshort5 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.

comment:2 westi5 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?

comment:3 ryan5 years ago

  • Milestone changed from 2.7 to 2.8

I like the idea too, but it can wait.

comment:4 mrmist5 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.

comment:5 follow-up: janeforshort5 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?

comment:6 in reply to: ↑ 5 mrmist5 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.

comment:7 Denis-de-Bernardy5 years ago

  • Keywords needs-patch added; sticky removed
  • Milestone changed from 2.8 to Future Release
  • Version set to 2.7

comment:8 mrmist4 years ago

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

comment:9 nacin4 years ago

  • Owner set to nacin
  • Status changed from new to reviewing

nacin4 years ago

comment:10 nacin4 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.

nacin4 years ago

comment:11 mrmist4 years ago

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

comment:12 nacin4 years ago

  • Milestone changed from Future Release to 3.1
  • Status changed from reviewing to accepted

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

nacin4 years ago

Patch refreshed against [15742].

comment:13 westi3 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

comment:14 nacin3 years ago

  • Resolution set to fixed
  • Status changed from accepted to 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.