Opened 14 years ago
Closed 14 years ago
#14135 closed defect (bug) (fixed)
edit_posts_per_page
Reported by: | tslice | Owned by: | sorich87 |
---|---|---|---|
Milestone: | 3.1 | Priority: | normal |
Severity: | minor | Version: | 3.0 |
Component: | Plugins | Keywords: | has-patch regression |
Focuses: | Cc: |
Description
Looks like a filter name was changed for edit_posts_per_page. A workaround has been to hook into both: edit_posts_per_page && edit_post_per_page (note the missing or added 's').
Attachments (8)
Change History (38)
#3
@
14 years ago
The patch also fixes #14342. The affected code was all added in 3.0, so both should be fine under 3.0.1.
#4
@
14 years ago
The second patch uses the 20 in [15444] and less confusing variable names.
Anyone using these filters would have been using both filters to get the correct display, so switching to using the same filter should not adversely affect anyone.
#6
@
14 years ago
I don't see why the filter needs to be removed? That's a generic filter and should remain if only for back compat. Possibly even added into template.php I'd think.
#7
@
14 years ago
It was added in 3.0, so it's only covering backward compatibility for 33 days. Anyone using it will also have to use the other filter as well or the page count is off.
Do you want me to redo the patch & put the generic one back and add it to includes/post.php?
#8
@
14 years ago
http://core.trac.wordpress.org/browser/branches/2.9/wp-admin/includes/post.php#L853
It used to be edit_posts_per_page. We changed it in wp-admin/includes, but didn't change this instance. Really, both spots should have both filters, generic (old) followed by specific (new). Unless I'm missing something -- does that make sense?
#9
@
14 years ago
Added. I also added the post_type to the generic filter.
Even without your explanation above, in the 3.0 cycle we added quite a few of the generic filters because they are useful. So, the generic one should remain here for consistency.
#12
@
14 years ago
(Now that I looked...) In _option & _transient functions they are the opposite order- specific first, generic second. We should go for consistency.
#17
@
14 years ago
- Milestone changed from 3.0.1 to 3.1
- Resolution fixed deleted
- Status changed from closed to reopened
#19
@
14 years ago
The previous changeset did not take into account 'wp-admin/includes/template.php'. The generic filter was not added in this file.
I don't think 'edit_pages_per_page' is necessary, since 'edit_posts_per_page' accepts the post type as parameter.
#21
@
14 years ago
Replying to sorich87:
I don't think 'edit_pages_per_page' is necessary, since 'edit_posts_per_page'
accepts the post type as parameter.
good point
#22
@
14 years ago
- Keywords regression added
- Milestone changed from 3.0.3 to 3.1
That's not the point though, edit_pages_per_page was in 2.9, and now it's not in 3.0.
#24
@
14 years ago
- Keywords has-patch added; needs-patch removed
- Owner set to sorich87
- Status changed from reopened to accepted
#25
@
14 years ago
- Milestone 3.1 deleted
- Resolution set to wontfix
- Status changed from accepted to closed
At this late stage, the new way is established. There's little point in adding legacy filters.
#26
@
14 years ago
- Resolution wontfix deleted
- Status changed from closed to reopened
Even if we don't want to add the legacy filter 'edit_pages_per_page', the original issue still remains:
The use of the filter 'edit_posts_per_page' is not consistent. That filter should be applied not only to the posts query, but also to the screen options.
Actually, when you use the filter to set the number of posts, the screen option doesn't show your value set via the filter but the default value. There is no consistency between the actual number of posts displayed and the number shown in the screen options.
The reporter is referring to the @todo on line 51 of wp-admin/edit.php. Around line 900 of wp-admin/includes/post.php is the edit_ . $post_type . _per_page.