[wp-trac] [WordPress Trac] #25255: Extend admin-ajax to detect multiple user capability and admin-ajax.php does not return 0

WordPress Trac noreply at wordpress.org
Sun Sep 8 14:23:44 UTC 2013


#25255: Extend admin-ajax to detect multiple user capability and admin-ajax.php
does not return 0
---------------------------+------------------------------
 Reporter:  godhulii_1985  |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  General        |     Version:  3.6
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+------------------------------

Comment (by godhulii_1985):

 Replying to [comment:1 markoheijnen]:
 > The codex page http://codex.wordpress.org/AJAX_in_Plugins does describe
 the need of die(). I don't think we should change to just die() when the
 developer doesn't do it in their code. Main reason is that the code in
 general is used for WordPress core itself. I do like the idea of a 404
 header when you don't handle die() correctly.
 >
 > Also I can see why we need to have an header included to a function like
 wp_send_json_error() to a status code as 400.
 >
 > I disagree on the part that WP should handle capabilities. Since basic
 capability checks can be done but you can't map meta capabilities. Since
 does do need to know more information like the 'edit_post' capability need
 to know the post ID.

 Hi Heijnen,

 Thanks for your reply. I noticed in firebug console that wp-admin uses
 this, however if core needs that then definitely it should be there.

 We both agree that wordpress should provide some feedback in case of a
 developer forgot to use die() properly.

 Actually I mentioned basic/same capability like edit_categories,
 manage_options etc. My intention behind the sample code fragment was:
 ''New functionality to distribute and control ajax functions capability
 just like menu pages/submenu pages.''

 [[br]]
 Thanks,
 -Ahmed.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25255#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list