Excess dependencies
It looks it was some kind of internal malfunctioning of webpack. After deleting everything from plugin directory (saving src files aside) and again installing @wordpress/create-block, the problem was solved.
It looks it was some kind of internal malfunctioning of webpack. After deleting everything from plugin directory (saving src files aside) and again installing @wordpress/create-block, the problem was solved.
You don’t have to provide source or dependencies, they’re already registered by the script loader with those values, you just need to enqueue the proper handle.
What is the best way to load the dependencies for the WP_Filesystem? The first or the second code part? WP_Filesystem() is used in conjunction with the global $wp_filesystem variable, so if you use it, then the second code part should be used. And WP_Filesystem() must be called so that the global $wp_filesystem variable is properly … Read more
If the parent theme bundles all vendor scripts in one file, you can’t require/enqueue them separately. From WP’s point of view, they are one single resource/dependency. Look into any page’s source-code or use a plugin (such as “debug this”) to get the script’s register name so you could specify it as dependency. In your case … Read more
You can add the following code in your plugin. I have used this in my ARB booking plugin and it worked perfectly. The full details of the code with explanation can be found here: class FT_AdminNotice { protected $min_wc=”5.0.0″; //replace ‘5.0.0’ with your dependent plugin version number /** * Register the activation hook */ public … Read more
It appears that calling the following from your theme folder should do the job: npm install npm run build Source: “How to Use Webpack in WordPress“.
On your plugin activation hook method you can check if CMB plugin is installed and/or activated. You can check this using the following methods: is_plugin_active(): only available from within the admin pages function_exists() or class_exists(): available anywhere once they are PHP core methods If CMB is not installed, you can throw an error message in … Read more
wp_enqueue_script is for… scripts. You want wp_enqueue_style (and wp_register_style) for stylesheets. Also note that you can enqueue as many things as you’d like in a single function, no need to create a separate function for each. You can also pass all the same arguments to enqueue as you do to register, no need to register … Read more
There is much safer way of removing jquery-migrate… Your code is almost correct, but first you remove jQuery and then add it again. If dependencies for jQuery will change, then your code will cause problems. But you don’t have to remove script to change its dependencies. You can do exactly that: function remove_jquery_migrate( $scripts ) … Read more
WordPress with Composer and different plugins for dev/live.