[wp-trac] [WordPress Trac] #28774: Hooking into wp_ajax_upload_attachment

WordPress Trac noreply at wordpress.org
Fri Aug 22 04:13:45 UTC 2014


#28774: Hooking into wp_ajax_upload_attachment
-------------------------------+------------------------------
 Reporter:  jshreve            |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by jshreve):

 Replying to [comment:1 nacin]:
 > What are you trying to do?

 There are a few places where we are embedding stuff from core (like the
 media manager or wplink) on NewDash (WordPress.com / blog id 1) - for
 example in the new posting experience at WordPress.com/post/.

 To embed/use the functionality outside of wp-admin we pass in a blog ID to
 the ajax call and unhook some of the wp_ajax_* hooks, switch_to_blog; cap
 check, call the wp_ajax_* function, restore_current_blog.

 I don't think I ended up needing to do anything with
 wp_ajax_upload_attachment itself - but I think the patch is still valid
 (its the only wp_ajax_* action you can't touch with hooks).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28774#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list