WordPress v5.0.3 Gutenberg & JS error “Uncaught SyntaxError: missing ) after argument list”
The issue for me was the clean_script_tag() function from Soil. Removing add_filter(‘script_loader_tag’, ‘clean_script_tag’); solved the bug for me.
The issue for me was the clean_script_tag() function from Soil. Removing add_filter(‘script_loader_tag’, ‘clean_script_tag’); solved the bug for me.
You can use dangerouslysetinnerhtml, a special HTML attribute in React: dangerouslySetInnerHTML is React’s replacement for using innerHTML in the browser DOM. In general, setting HTML from code is risky because it’s easy to inadvertently expose your users to a cross-site scripting (XSS) attack. So, you can set HTML directly from React, but you have to … Read more
The core blocks appear to be defined in the Gutenberg repository on Github, in the block-library package here: https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src.
So I guess you’re still using WordPress version 5.3.x? 🙂 Because if so (and I was), then yes, the users endpoint (at wp/v2/users) is not included in the default entities. But you can manually add it: // Add the endpoint. wp.data.dispatch( ‘core’ ).addEntities( [ { name: ‘user’, kind: ‘root’, baseURL: ‘/wp/v2/users’ } ] ); And … Read more
Use react-sortable-hoc Draggable is lacking documentation and I did not had the time to dig into it. But the above is for you. I used it to create the sidebar Entry Content/Primary Sidebar control – used to reorder my theme content/sidebar!
When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
The only way I could get this to work in WP 5 was to install the Classic Editor. Then I could use media_view_settings to add the tab. add_filter(‘media_view_settings’, ‘addMediaTab’); function addMediaTab($settings) { $settings[‘tabs’] = array(‘mymediatab’ => ‘My Media Tab’); return $settings; } BUT it appears the new UI doesn’t include those sections in Gutenberg, you … Read more
Use import { cleanForSlug } from “@wordpress/editor”; in your block.js file to import the function in and then use the it like cleanForSlug(stringToClean) to create the ID’s.
As already described in the comments, many WordPress Gutenberg plugins do not use the strict JSON format as WordPress prescribes… (and poorly documented) So it comes to two problems: Sometimes the data is in a JSON format, which parse_blocks() cannot read. If no change is made here, for example, the value attr will be NULL … Read more
Once Again: How to Remove Option from Gutenberg Editor for Specific Block in theme.json