Skip to main content
10 events
when toggle format what by license comment
Mar 5, 2019 at 15:44 comment added Luke Keller Interesting @ChadHolden! I ended up abandoning the approach entirely and going a different direction. If I were to do this again (assuming I would fail then as well), I'd look into creating a custom Component to render the select dropdown. Hope that helps anyone who is struggling to get this to work!
Feb 27, 2019 at 3:17 comment added Chad Holden @LukeKeller it works for me on production sites.
Feb 25, 2019 at 20:40 comment added Luke Keller Did this actually work for anyone? I've implemented a similar approach to no avail. Promises are resolved asynchronously so I'm not sure how this would prevent the editor from being loaded.
Nov 29, 2018 at 22:38 vote accept JakeParis
Jan 10, 2023 at 15:15
Nov 29, 2018 at 14:43 comment added Chad Holden Also be aware that if you want to use wp.apiFetch in your js file, you need to load the wp-api-fetch file in your PHP file when registering scripts (wp_register_script). See my post here wordpress.stackexchange.com/questions/320483/…
Nov 29, 2018 at 14:41 comment added Chad Holden Indeed! If you load it before the edit: part, it gets loaded with the page before the elements are rendered. The constants are the FIRST thing in your block js file. Before you even use registerBlockType you define the constants and give them value.
Nov 29, 2018 at 2:22 comment added JakeParis Thanks Chad. Have you done it this way? If so, have you found that the data gets loaded before the element is rendered? I was running into an issue where the data was not getting loaded in time, and so wasn't "connected" to the element.
Nov 28, 2018 at 20:34 history edited Chad Holden CC BY-SA 4.0
added selectcontrol element.
Nov 28, 2018 at 19:10 review First posts
Nov 28, 2018 at 21:25
Nov 28, 2018 at 19:07 history answered Chad Holden CC BY-SA 4.0