WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 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 4 years ago.
14543.2.patch (559 bytes) - added by JohnPBloch 4 years ago.
Changing ternary operators to regular if statement
14543.3.patch (1.6 KB) - added by johnpbloch 4 years ago.
New Patch
14543.diff (4.5 KB) - added by nacin 3 years ago.

Download all attachments as: .zip

Change History (23)

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

JohnPBloch4 years ago

comment:2 JohnPBloch4 years ago

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

comment:3 JohnPBloch4 years ago

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

Patch submitted.

JohnPBloch4 years ago

Changing ternary operators to regular if statement

johnpbloch4 years ago

New Patch

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

comment:5 nacin3 years ago

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

comment:6 jane3 years ago

+1

comment:7 jane3 years ago

  • Keywords dev-feedback added

comment:8 follow-up: trevmillion3 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 :)

comment:9 trevmillion3 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.

comment:10 in reply to: ↑ 8 duck_3 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.

comment:11 nacin3 years ago

  • Keywords dev-feedback removed

New patch removes all limits.

nacin3 years ago

comment:12 JohnPBloch3 years ago

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

comment:13 nacin3 years ago

  • Keywords commit added

comment:14 nacin3 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.

comment:15 nacin3 years ago

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

comment:16 nacin3 years ago

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

comment:17 nacin3 years ago

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

comment:18 nacin3 years ago

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

comment:19 nacin3 years ago

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

Note: See TracTickets for help on using tickets.