Ticket #6196 (closed enhancement: fixed)

Opened 6 months ago

Last modified 6 months ago

New action hook for edit.php for plugin authors to add new filter field...

Reported by: nerrad Assigned to: westi
Priority: normal Milestone: 2.5
Component: Administration Version: 2.5
Severity: blocker Keywords: needs-patch regression
Cc:

Description

Why? If plugin authors want to be able to add a new field for filtering the posts on the "Manage->Posts" menu they can use this action hook to insert the form field before the submit button.

Currently (2.5 beta 1) it is possible to add a field via the 'restrict_manage_posts' action hook (see attached screenshot for example) but that is a cludgy solution at best and isn't good for user-friendly ui.

(This would be a complement to ticket: #5899)

Attachments

newaddactionfilterfield.JPG (55.1 kB) - added by nerrad on 03/13/08 04:07:08.
Example screen shot using 'restrict_manage_posts' action hook
addnewfilterfield-edit.php.diff (0.5 kB) - added by nerrad on 03/13/08 04:07:42.
suggested implementation
pjw-wp-filter-manage-posts-2.3.php (2.0 kB) - added by westi on 03/13/08 20:36:47.
restrict_manage_post plugin which works for 2.3
pjw-wp-filter-manage-posts-2.5.php (1.8 kB) - added by westi on 03/13/08 20:37:14.
restrict_manage_post plugin which works for 2.5

Change History

03/13/08 04:07:08 changed by nerrad

  • attachment newaddactionfilterfield.JPG added.

Example screen shot using 'restrict_manage_posts' action hook

03/13/08 04:07:42 changed by nerrad

  • attachment addnewfilterfield-edit.php.diff added.

suggested implementation

03/13/08 07:22:19 changed by westi

  • keywords changed from has-patch to has-patch regression?.
  • owner changed from anonymous to westi.
  • status changed from new to assigned.
  • severity changed from normal to blocker.
  • milestone changed from 2.6 to 2.5.

Hmm that looks like restrict_manage_posts may have ended up in the wrong place after the latest changes.

I'll look into this.

(follow-up: ↓ 3 ) 03/13/08 14:09:50 changed by nerrad

I don't think restrict_manage_posts is in the wrong place. My understanding is that it's purpose is for adding hook for filtering by type should a plugin author create a new post type. Therefore you'd want restrict_manage_posts to be where it is for adding in the same line as the other post-type filter options.

However, my suggested new action hook would be for plugin authors to add in a new form-field for filtering by a new post-taxonomy in the indicated location. It'd be nice to have the option of the two possible locations for insertion rather than just one (due to the new ui layout)

(in reply to: ↑ 2 ) 03/13/08 19:11:58 changed by westi

  • keywords changed from has-patch regression? to needs-patch regression.

Replying to nerrad:

I don't think restrict_manage_posts is in the wrong place. My understanding is that it's purpose is for adding hook for filtering by type should a plugin author create a new post type. Therefore you'd want restrict_manage_posts to be where it is for adding in the same line as the other post-type filter options. However, my suggested new action hook would be for plugin authors to add in a new form-field for filtering by a new post-taxonomy in the indicated location. It'd be nice to have the option of the two possible locations for insertion rather than just one (due to the new ui layout)

restrict_manage_post is in the wrong place - trust me I invented it ;-) [4321]

Unfortunately because of the design of the new admin ui where the whole list is inside the form we can't let plugins add there own form.

I think we need to move restrict_manage_post inside the form back where it should be rather than add another hook - and make sure to notify plugin authors that it has changed slightly.

03/13/08 20:36:47 changed by westi

  • attachment pjw-wp-filter-manage-posts-2.3.php added.

restrict_manage_post plugin which works for 2.3

03/13/08 20:37:14 changed by westi

  • attachment pjw-wp-filter-manage-posts-2.5.php added.

restrict_manage_post plugin which works for 2.5

03/13/08 20:39:07 changed by westi

I have attached two sample plugins.

The first was my original test plugin for this hook when it was introduced and works fine in 2.3

The second is a version which will work for 2.5 once I check in a fix for this hook in the next few minutes.

Please re-open if there are still issues.

03/13/08 20:39:56 changed by westi

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [7274]) Move the restrict_manage_post hook back to a useful place. Fixes #6196.

03/13/08 23:21:50 changed by nerrad

Works for me :) Thanks!