[wp-trac] [WordPress Trac] #42840: New plugin / theme editor wp_ajax_ save hook not working or inexistent

WordPress Trac noreply at wordpress.org
Fri Dec 8 16:33:07 UTC 2017


#42840: New plugin / theme editor wp_ajax_ save hook not working or inexistent
---------------------------+-----------------------------
 Reporter:  cristianuibar  |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Editor         |    Version:  4.9.1
 Severity:  normal         |   Keywords:
  Focuses:                 |
---------------------------+-----------------------------
 Hello,

 We are trying to use a hook using:
 https://developer.wordpress.org/reference/hooks/wp_ajax__requestaction/
 for the new Code Editor in Plugins and Theme.

 Add any of these hooks using add_action(), and they will not work.

 Neighter
 wp_ajax_edit_theme_plugin_file, nor
 wp_ajax_edit-theme-plugin-file
 works.

 I expected the hooks to work and they didn't.

 We tried an alternative using the 'wp_doing_ajax' hook, but it executes
 twice per request, even though we were checking for:
 {{{#!php
 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit-theme-
 plugin-file')
 }}}

 Best,
 Cristian Uibar

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


More information about the wp-trac mailing list