[wp-trac] [WordPress Trac] #52015: Provide an ID for the author selector on the Block Editor

WordPress Trac noreply at wordpress.org
Thu Dec 10 13:01:00 UTC 2020


#52015: Provide an ID for the author selector on the Block Editor
------------------------------+-----------------------------
 Reporter:  Molongui          |      Owner:  (none)
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Editor            |    Version:  5.6
 Severity:  normal            |   Keywords:
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 Since WP 5.6 the **author selector** under the **Status & visibility**
 panel in the sidebar of the Block Editor have no HTML ID, so there is no
 trivial way to target it with a CSS rule. Neither with javascript.

 My **request** to WP core developers is to provide either an ID or a CSS
 class to the component row of that field. Other fields in that same panel
 have an additional class, like the Visibility (.edit-post-post-visibility)
 or Publish (.edit-post-post-schedule) fields.

 Looking into the source code, I guess it would be as easy as editing the
 **wp-includes/js/dist/edit-post.js** file to change this piece of code:


 {{{
 function PostAuthor() {
   return
 Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["PostAuthorCheck"],
 null,
 Object(external_this_wp_element_["createElement"])(external_this_wp_components_["PanelRow"],
 null,
 Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["PostAuthor"],
 null)));
 }
 }}}

 to something like this:


 {{{
 function PostAuthor() {
   return
 Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["PostAuthorCheck"],
 null,
 Object(external_this_wp_element_["createElement"])(external_this_wp_components_["PanelRow"],
 { className: "edit-post-post-author" },
 Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["PostAuthor"],
 null)));
 }
 }}}

 Thanks!

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


More information about the wp-trac mailing list