WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14543 closed defect (bug) (fixed)

Recent Posts Widget post count setting/display discrepancy

Reported by: Nao Owned by: JohnPBloch
Milestone: 3.1 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: has-patch commit
Focuses: Cc:

Description

Recent Posts Widget can only display 1-15 posts.

http://core.trac.wordpress.org/browser/trunk/wp-includes/default-widgets.php#L537

However, you can save any negative/positive integer from the widget setting field.
The number you can use there should be limited to the min (1) and max (15, if this remains so).

Attachments (4)

14543.patch (588 bytes) - added by JohnPBloch 6 years ago.
14543.2.patch (559 bytes) - added by JohnPBloch 6 years ago.
Changing ternary operators to regular if statement
14543.3.patch (1.6 KB) - added by johnpbloch 6 years ago.
New Patch
14543.diff (4.5 KB) - added by nacin 6 years ago.

Download all attachments as: .zip

Change History (23)

#1 @nacin
6 years ago

  • Milestone changed from Awaiting Review to 3.1

I think the dashboard widgets properly adjust for the limit upon save. We should be doing the same here.

@JohnPBloch
6 years ago

#2 @JohnPBloch
6 years ago

  • Owner set to JohnPBloch
  • Status changed from new to accepted

#3 @JohnPBloch
6 years ago

  • Keywords has-patch added
  • Status changed from accepted to assigned

Patch submitted.

@JohnPBloch
6 years ago

Changing ternary operators to regular if statement

@johnpbloch
6 years ago

New Patch

#4 @johnpbloch
6 years ago

I removed the min/max check in WP_Widget_Recent_Posts::widget and added the same functionality in WP_Widget_Recent_Comments with a filter to allow increasing the default upper limit of the comments widget.

#5 @nacin
6 years ago

Let's remove upper bounds from all widgets including the dashboard widgets.

#6 @jane
6 years ago

+1

#7 @jane
6 years ago

  • Keywords dev-feedback added

#8 follow-up: @trevmillion
6 years ago

Came here to submit this bug. Lets you specify any integer above 15 in the front-end, but the code limits you to 15 in default-widgets.php. Wasted a lot of time figuring this one out.

Does keyword "has-patch" mean this is fixed? Have patience, first post :)

#9 @trevmillion
6 years ago

Saw the patch details. Looks really cool! Bug tracking is fun!

--

There is no shame whatsoever in double posting, and I do not apologize.

#10 in reply to: ↑ 8 @duck_
6 years ago

Replying to trevmillion:

Does keyword "has-patch" mean this is fixed? Have patience, first post :)

has-patch means that someone has submitted a possible fix, but the fix may not necessarily have made it into core yet. That has to wait until a committer has reviewed it and actually applied the patch.

See the codex for a list of commonly used keywords.

#11 @nacin
6 years ago

  • Keywords dev-feedback removed

New patch removes all limits.

@nacin
6 years ago

#12 @JohnPBloch
6 years ago

Nacin's patch (14543.diff) works on my end.

#13 @nacin
6 years ago

  • Keywords commit added

#14 @nacin
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [16922]) Remove ceilings on recent comments and posts widgets and dashboard widgets. fixes #14543.

#15 @nacin
6 years ago

(In [16923]) Remove unneeded stripslashes. see #14543.

#16 @nacin
6 years ago

(In [16923]) Remove unneeded stripslashes. see #14543.

#17 @nacin
6 years ago

(In [16923]) Remove unneeded stripslashes. see #14543.

#18 @nacin
6 years ago

(In [16923]) Remove unneeded stripslashes. see #14543.

#19 @nacin
6 years ago

(In [16923]) Remove unneeded stripslashes. see #14543.

Note: See TracTickets for help on using tickets.