WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#11458 closed defect (bug) (fixed)

Remove unnecessary $posts_per_page global in admin.php

Reported by: nacin Owned by:
Milestone: 3.0 Priority: low
Severity: minor Version: 2.9
Component: Administration Keywords: has-patch tested
Focuses: Cc:

Description

First discussed in #11385.

There is an orphaned $posts_per_page = get_option('posts_per_page') in the admin.php bootstrap. The variable is never used and appears to be an artifact that is left over from before the time of screen options.

The posts_per_page option is the reading option for the number of posts to display per page in a theme.

In the off-chance a plugin used this variable, it is overwritten in post.php anyway, and would provide incorrect values on any other page, as they have their own *_per_page user options. As of [12375] they also have a complete set of filters as well.

If someone feels that broken back compat is necessary here, then we can wontfix.

Attachments (1)

11458-posts_per_page.diff (358 bytes) - added by nacin 5 years ago.

Download all attachments as: .zip

Change History (4)

@nacin5 years ago

comment:1 @hakre5 years ago

I took a look as well and did not find any use of the global $posts_per_page within the admin. Looks OK to me to be zapped.

comment:2 @hakre5 years ago

  • Keywords tested added

reviewed and tested again: OK. patch applies clean.

comment:3 @nacin5 years ago

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

[12551], thanks westi.

Note: See TracTickets for help on using tickets.