Opened 6 years ago
Closed 6 years ago
#52015 closed enhancement (reported-upstream)
Provide an ID for the author selector on the Block Editor
| Reported by: | Molongui | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Editor | Version: | 5.6 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
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!
Change History (3)
This ticket was mentioned in Slack in #core by lukecarbis. View the logs.
6 years ago
#3
@
6 years ago
- Focuses coding-standards removed
- Milestone Awaiting Review
- Resolution → reported-upstream
- Status new → closed
Hi!
This has been reported upstream in the Gutenberg GitHub repository, and work can continue on this issue:
https://github.com/WordPress/gutenberg/issues/12067
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Thanks for the report. This is a wider problem in the block editor in general, none of the component rows in the sidebar include distinct class or id attributes.
I think this needs to be reported upstream on the Gutenberg repo.