slate icon indicating copy to clipboard operation
slate copied to clipboard

Issue: Showing menu items in dashboard/editing screens

Open DigitalBerry opened this issue 4 years ago • 7 comments

I'm getting an issue that causes all the pages to display on the admin "menu" screen, and when editing using Elementor.

Here's some screen grabs:

WP admin Menu screen - https://snipboard.io/GkHoQ7.jpg

ElementorPro theme builder header section editing screen - https://snipboard.io/yH9NYU.jpg

I narrowed the issue down to Slate after deactivating all plugins and switching them on one by one until the issue appeared, and it did with Slate.

DigitalBerry avatar Apr 29 '20 09:04 DigitalBerry

Any update on this, its been a couple of weeks now!

I really like the plugin, but will have to remove it from 30+ sites if this isn't fixed soon.

DigitalBerry avatar May 11 '20 09:05 DigitalBerry

Hi DigitalBerry,

I just installed the free Elementor plugin from the WP plugin directory and am not seeing the issue. Are there specific steps I need to take to reproduce what you're seeing?

ryansommers avatar May 11 '20 15:05 ryansommers

The only possible connection I can make it to is a cache issue (I use Siteground) however, I don't run any form of cache on my dev sites and it still appears.

DigitalBerry avatar May 11 '20 19:05 DigitalBerry

I see this error too sometimes within the Menu admin panel...

Warning: Cannot modify header information - headers already sent by (output started at /public_html/wp-content/plugins/slate-admin-theme/slate-admin-theme.php:54) in /public_html/wp-admin/admin-header.php on line 9

DigitalBerry avatar May 11 '20 19:05 DigitalBerry

Hi Ryan, So I found some CSS that hides it, thought I would share...

.post-state { display: none;}

DigitalBerry avatar May 13 '20 20:05 DigitalBerry

The .post-state is also an issue for Redux Framework 4. Your filter found here is the issue: add_filter( 'display_post_states', 'slate_pro_post_state' );. I'm not sure why, but this is firing on the front-end and causing issues.

Perhaps bind this to the admin?

dovy avatar Jul 28 '20 14:07 dovy

This is how I solved it:

// Replace slate filer that prints out menu post states in Elementor
add_action('admin_init', function()
{
    remove_filter('display_post_states', 'slate_post_state', 11);
    
    add_action( 'current_screen', function()
    {
        if (get_current_screen()->id === 'nav-menus') add_filter('display_post_states', '__return_false', 11);
    });
});

AmibeWebsites avatar Jan 10 '21 09:01 AmibeWebsites