Settings page doesn’t display properly
-
Hello, thank you for this great plugin!
During my tests, I couldn’t display the “Settings” page correctly; it would appear and disappear with an error message in the console related to “sprintf”.
To fix the problem, I added a mu-plugin; here’s the code:
PHP file :add_action( 'admin_enqueue_scripts', function () { wp_enqueue_script( 'sitenotes-i18n-fix', plugin_dir_url( __FILE__ ) . 'sitenotes-i18n-fix.js', [ 'wp-i18n' ], null, true ); });JS file :
if ( window.wp?.i18n && typeof window.sprintf === 'undefined' ) { window.sprintf = wp.i18n.sprintf; }If it helps 🙂
Cheers.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.