
The plugin to allow users to delete their own account from the frontend – WP Frontend Delete Account has been updated to 1.6.0.
The new release contains the changes to make the compatibility with WordPress 5.9 released in late January and various other bug fixes to make the account deletion process even more smooth.
[For Nerds] What’s been the changes?
While testing with the Twenty Twenty-Two theme and development version of WordPress 5.9, wp_localize_script() wasn’t working and there was a JavaScript error in the console wpfda_plugins_params isn’t defined [issue]. This led me to think that there’s probably an issue with WordPress 5.9 or Twenty Twenty-Two theme. So, I added a GitHub issue on the Twenty Twenty-Two theme repository where it’s concluded the issue exists in any block theme. for example an empty theme, a bare minimum for a block theme.
After that, I added the question in the WordPress support forum where I found the approach of using wp_localize_script() wasn’t correct – it shouldn’t be used from within the shortcode callback. We should also use wp_add_inline_script() to pass generic data from PHP to page script. So, it turned out to be a bug within the plugin. Thanks to @bcworkz
[fix] Instead of using wp_localize_script(), the JavaScript variable is passed directly within the <script> tag along with the shortcode content.
Thank you!