Wrapping ShortCode is broken in WordPress 6.2
-
Hello,
I just upgraded to WordPress 6.2 and i had an error when using Wrapping ShortCode. There is an error in the console as the navigator can’t find a file (404) located at this URL:
https://myserver/portail/var/www/html/portail/wp-content/plugins/wrapping-shortcode/build/index.js?c=41cf2bf4
The file URL contains the actual disk path (/var/www/html/), which is wrong.
It comes from:
/var/www/html/portail/wp-content/plugins/wrapping-shortcode/classes/class-enqueue.php
Which contains:
$script_src = realpath( $plugin_path . ‘/build/index.js’ );
wp_enqueue_script(
$script, // handle
$script_src, // script file
$dependencies, // dependencies
false, // version
false // in_footer
);When script_src should be :
trailingslashit ( plugin_dir_url( dirname( __FILE__ ) )) . 'build/index.js',
Once fixed, I do get another error though, but not a 404:
blocks.min.js?c=41cf2bf4:3 Block "asm-wrapping-shortcode/asm-wrapping-shortcode-block" is already registered.
It looks like the JavaScript file is actually loaded twice when using the Wordress Block Editor, for some reason (i have multiple Wrapping Shortcode components in my page, don’t know if that helps)
Thanks,
Fabien
- The topic ‘Wrapping ShortCode is broken in WordPress 6.2’ is closed to new replies.