[wp-trac] [WordPress Trac] #31206: Move AJAX action parameters out of the method body and into the declaration.

WordPress Trac noreply at wordpress.org
Sun Feb 1 23:09:51 UTC 2015


#31206: Move AJAX action parameters out of the method body and into the
declaration.
-------------------------+-----------------------------
 Reporter:  morganestes  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 `admin-ajax.php` has several methods that require an `$action` parameter,
 then immediately set that parameter in the body of the method to the
 desired string if it's not set, which seems a bit counter-intuitive.

 I propose removing the conditional check completely (since it's not
 checking for a value, just the presence) and move the desired string into
 the method declaration as a default value.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31206>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list