humanmade / authorship

A modern approach to author attribution in WordPress.
GNU General Public License v3.0
67 stars 7 forks source link

Add classname to author select fill #85

Open tomjn opened 3 years ago

tomjn commented 3 years ago

In a project we need to show/hide the author selection panel dynamically based on another option, but there are no mechanisms to do this.

Unlike the other rows in the post status panel, authorships row does not have a special classname that could be used to toggle with CSS in place of other mechanisms

Luckily, there is a className prop on the PluginPostStatusInfo component: https://github.com/WordPress/gutenberg/blob/3da717b8d0ac7d7821fc6d0475695ccf3ae2829f/packages/edit-post/src/components/sidebar/plugin-post-status-info/index.js#L55

https://github.com/humanmade/authorship/blob/develop/src/plugin.tsx#L13 could be modified to add this prop, and we would be able to toggle the visibility of this UI without resorting to DOM hacking