The excerpt panel in the Gutenberg block editor has the label text "Write an excerpt (optional)"
How can this text be edited? Specifically I want to remove "(optional)".
I've attempted to target the label with JS, but neither of the below work (just see an empty collection in the console). If I run document.getElementsByClassName('e1puf3u2')
in the console, I get back the label element.
wp.domReady(() => {
let labels = document.getElementsByClassName('e1puf3u2');
console.log(labels);
});
document.addEventListener("DOMContentLoaded", function(event) {
let labels = document.getElementsByClassName('e1puf3u2');
console.log(labels);
});