You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
Tested in WordPress 5.6.
I guess there's something in jQuery update that breaks existing functionality.
To deal with call stack order I wrapped this function https://github.com/VaLeXaR/wp-multilang/blob/master/includes/admin/class-wpm-admin-assets.php#L197 with setTimeout, and it works fine even with 0 delay, but I hope it will be fixed with the next update.
This fix not elegant at all, for sure, but since there are timeouts in wp-edit-post, maybe it's not that bad after all :)
The text was updated successfully, but these errors were encountered:
pufflik
changed the title
Language switcher disappears on Post Editing page
Language switcher disappears on Post Editing page (quick and dirty fix inside)
Jan 5, 2021
Nice hack, I've looked a lot around for finding a solution for the sometimes appearing and mostly disappered language switcher in the block editor. To think your approach a little bit further, I do a check if the toolbar exists, and if not, I'll set a timeout. Works for me fine. :)
$(window).on('pageshow', function(){
if ($('#wpm-language-switcher').length === 0) {
var language_switcher = wp.template( 'wpm-ls-customizer' );
var wpm_add_language_switcher_deferred = function() {
var toolbar = $('.edit-post-header-toolbar');
if(toolbar.length) {
toolbar.prepend(language_switcher);
} else {
window.setTimeout(wpm_add_language_switcher_deferred, 100);
}
}
wpm_add_language_switcher_deferred();
}
});
Tested in WordPress 5.6.
I guess there's something in jQuery update that breaks existing functionality.
To deal with call stack order I wrapped this function https://github.com/VaLeXaR/wp-multilang/blob/master/includes/admin/class-wpm-admin-assets.php#L197 with
setTimeout
, and it works fine even with0
delay, but I hope it will be fixed with the next update.This fix not elegant at all, for sure, but since there are timeouts in
wp-edit-post
, maybe it's not that bad after all :)The text was updated successfully, but these errors were encountered: