[wp-trac] [WordPress Trac] #53981: The 'media_buttons' hook does not work for contributors.

WordPress Trac noreply at wordpress.org
Mon Aug 23 19:10:13 UTC 2021


#53981: The 'media_buttons' hook does not work for contributors.
--------------------------+-----------------------------
 Reporter:  jamesros161   |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  5.8
 Severity:  major         |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 ##Problem Details##
 Plugins are given the `media_buttons` hook to be able to add additional
 buttons to the editor interface. The way this is implemented in
 _WP_Editors::editor(), the user role must include the `upload_files`
 capability. While this makes sense when it comes the default `Add Media`
 button, it doesn't make sense for some other buttons such as Post And Page
 Builder's Add Block button, or WeForms' Contact Form buttons. The plugin
 developers should be able to decide what capabilites the user needs to
 have for their custom buttons before hooking into that action.

 ##Suggested Resolution##
 My suggestion is that the existing `media_buttons` hook remain as it is,
 but that we add another hook just afterwards called `after_media_buttons`
 . This will allow those custom buttons to be rendered whenever the
 developer wishes them to be.

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


More information about the wp-trac mailing list