Opened 15 years ago
Closed 11 years ago
#17891 closed enhancement (fixed)
Pass $post_type to 'restrict_manage_posts'
| Reported by: | scribu | Owned by: | DrewAPicture |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4 |
| Component: | Posts, Post Types | Version: | |
| Severity: | normal | Keywords: | good-first-bug |
| Cc: | Focuses: | administration |
Description
It would be nice if the 'restrict_manage_posts' hook received the post type as an argument, rather than having to check the global.
Attachments (3)
Change History (18)
#9
follow-up:
↓ 11
@
11 years ago
- Keywords needs-docs added; has-patch removed
- Resolution fixed
- Severity minor → normal
- Status closed → reopened
The hook actually needs a full docbloc, see https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#1-functions-and-class-methods. Shouldn't be more than a couple lines.
#11
in reply to: ↑ 9
@
11 years ago
Replying to chriscct7:
The hook actually needs a full docbloc
Not sure what you're referring to. The 'restrict_manage_posts' hook is already fully documented in class-wp-posts-list-table. As @pavelevap pointed out, all we really need here is a changelog entry for the new parameter, unless I'm missing something.
#13
follow-up:
↓ 14
@
11 years ago
Sure, I will add patch in a while...
I found similar docs, but I am not sure if there is any standard for this sentence?
Added `$post_type` parameter. The `$post_type` parameter was added. Introduced the `$post_type` parameter. ...
#14
in reply to: ↑ 13
@
11 years ago
- Keywords needs-docs removed
- Owner changed from to
- Status reopened → reviewing
Replying to pavelevap:
Sure, I will add patch in a while...
I found similar docs, but I am not sure if there is any standard for this sentence?
Added `$post_type` parameter. The `$post_type` parameter was added. Introduced the `$post_type` parameter. ...
Personally, I prefer the second one:
The `$post_type` parameter was added.
I'll fix it on commit. Thanks for the patch!
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Now that we're not passing around the
$post_typeglobal, we should instead pass the whole$this->screenobject.