3

The double NOT operator (!!) It's simply a way to convert/type-cast a non-boolean value to a boolean value, and !! <expression> gives us the opposite of ! <expression>. let foo = 'bar'; // non-empty string console.log( ! foo, !! foo ); // false, true foo = ''; // now it's an empty string console.log( ! foo, !! foo ); // true, false Issues in ...


2

Anytime you want to use JavaScript in WordPress, you should enqueue it. Save the JS as a file, ie clickbutton.js inside your theme folder: document.getElementById("defaultOpen").click(); Then in functions.php, enqueue that file: add_action('wp_enqueue_scripts', 'wpse_371294_enqueue_js'); function wpse_371294_enqueue_js() { wp_enqueue_script('...


1

In your GalleryImage const { withSelect } = wp.data; const { compose } = wp.compose; // You should define __ const { __ } = wp.i18n; In your FeaturedGallery You need to return the element, and set a key for the element (which is a list item): ( I also removed the index because it's not being used.. if we define a variable, it should be used. :) ) And ...


Only top voted, non community-wiki answers of a minimum length are eligible