• My issue is identical to this closed one but on a multisite installation. This bug is affecting two of the three sites on the multisite network (including the primary domain site). The third site that is unaffected was created after the plugin was installed and configured.

    For the sites that are affected, I’ve even tried changing the exit button setting to the admin bar logo and a custom image, but the edit screen exit button does not respect it.

    Video of my issue (uploaded it to YouTube as unlisted and has chapters in the description so you can speed along my slow recreation): https://youtu.be/P2anh8dtMQk

    The closed thread said it was related to cache but it’s not clear to me how to clear that particular cache so that the exit icon can return to normal for the other two sites.

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter Tessa (they/them), AuRise Creative

    (@tessawatkinsllc)

    This has been bothering me still and I don’t see any movement here, so I decided to dig into the issue.

    In the plugin’s files /includes/classes/Admin_Settings.php on line 36, the plugin inserts line of JavaScript. This JS runs an interval every minute and does this check: if(jQuery(".edit-post-fullscreen-mode-close svg").length > 0 ){

    I put a debugger before that if-statement and it always returns false on the sites affected by this bug. On the sites where this works, it returned false once, then true, then false again (and kept looping and returning false because once it returned true that one time, the plugin changed the image to the exit icon). So I updated both the return objects in the private function get_editor_wp_logo and that JavaScript check.

    Basically, I just edited these two functions:

    public function remove_editor_wp_logo()
    {
    if (!wlcms_field_setting('hide_wordpress_logo_and_links')) {
        return;
    }
    
    $image = $this->get_editor_wp_logo();
            
    wlcms_set_hidden_css('.edit-post-header .edit-post-fullscreen-mode-close svg');
    wlcms_add_js(' var wlcms_change_back = setInterval(function() {if(jQuery(".edit-post-fullscreen-mode-close .wlcms_icon").length == 0 ){ jQuery(".edit-post-fullscreen-mode-close").html("' . $image . '");}if(jQuery(".edit-post-fullscreen-mode-close_site-icon").length > 0){jQuery(".edit-post-fullscreen-mode-close_site-icon").remove();}}, 1000);');
    }
    
    private function get_editor_wp_logo() {
    $gutenberg_exit_icon = wlcms_field_setting('gutenberg_exit_icon');
    $admin_bar_logo = wlcms_field_setting('admin_bar_logo');
            
    if($gutenberg_exit_icon) {
        $icon = "";
        if($gutenberg_exit_icon == 'admin-bar-logo') {
            $icon = wlcms_field_setting('admin_bar_logo');
        }elseif($gutenberg_exit_icon == 'custom-icon') {
            $icon = wlcms_field_setting('gutenberg_exit_custom_icon');
        }else {
            return '<span class=\"wlcms_icon dashicons dashicons-exit\"></span>';
        }
    
        return '<span id=\"wlcms_dashboard_logo\" class=\"wlcms_icon\"><img src=\"' . $icon . '\" alt=\"\" /></span>';
    }
    
    if($admin_bar_logo) {
        return '<span id=\"wlcms_dashboard_logo\" class=\"wlcms_icon\"><img src=\"' . $admin_bar_logo. '\" alt=\"\" /></span>';
    }
    
    return '<span class=\"wlcms_icon wlcms_dashboard_exitdashicons dashicons-exit\"></span>';
    
    }

    Basically, I updated it so that all of the icons/logos/whatever that is inserted by the plugin includes the wlcms_icon class which the loop checks for for inserting the image and then I additionally check for this strange image with the .edit-post-fullscreen-mode-close_site-icon class that I can only assume was added because my installation was a multisite.

    At any rate, this fixed my issue and I’d love if it could be included in your next update. Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Gutenberg Exit Button shows Favicon’ is closed to new replies.