[wp-trac] [WordPress Trac] #26869: Hook Docs completed files fixes
WordPress Trac
noreply at wordpress.org
Fri Apr 25 16:20:42 UTC 2014
#26869: Hook Docs completed files fixes
----------------------------+-----------------------------
Reporter: DrewAPicture | Owner:
Type: task (blessed) | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses: docs
----------------------------+-----------------------------
Comment (by DrewAPicture):
Replying to [comment:25 Otto42]:
> For the admin_post one, I suggest something more like this:
>
> {{{
> if ( !empty($_REQUEST['action']) )
> $request_action = '_' . $_REQUEST['action'];
> }}}
>
> and then have both:
>
> do_action( "admin_post_nopriv{$request_action}" );
> do_action( "admin_post{$request_action}" );
>
> In your if/else.
Yup, works for me. I was unsure about whether there would ever be a case
of "admin_post_" (invalid or empty action), and whether that would
actually constitute a separate, valid hook.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26869#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list