Admin-menu won't dis-collapse anymore (3 posts)

  1. digitaldonkey
    Posted 4 years ago #

    I need a "only-toplevel" Admin menu item. So there is no Page, I just need to trigger a action. It actually works expect, that after collapsing the menu it won't open, after being collapsed once.

    function clearcachify_menue() {
    <li class="wp-menu-separator"><div class="separator"></div></li>
     <li class="menu-top">
    	<div class="wp-menu-image">
    	  <a href="<?php print $GLOBALS['cache-clear-uri']; ?>">
    	  <img title="Clear cache" src="/wp-admin/images/generic.png">
    	 <a href="<?php print $GLOBALS['cache-clear-uri']; ?>" class="menu-top">Clear Cache</a>
    <?php }
  2. digitaldonkey
    Posted 4 years ago #

    Is this a bug? The collapse-button is behind my button in z-axis and can not be clicked anymore.
    It will work if I hack core: Ensure that collapse-button is the last Item.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  3. digitaldonkey
    Posted 4 years ago #

    In WordPress Version 3.3

    diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php
    index cdd81b2..8454a3d 100644
    --- a/wp-admin/menu-header.php
    +++ b/wp-admin/menu-header.php
    @@ -164,10 +164,6 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
                    echo "</li>";
    -       echo '<li id="collapse-menu" class="hide-if-no-js"><div id="collapse-button"><div></div></div>';
    -       echo '<span>' . esc_html__( 'Collapse menu' ) . '</span>';
    -       echo '</li>';
    @@ -181,6 +177,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
     _wp_menu_output( $menu, $submenu );
     do_action( 'adminmenu' );
    +echo '<li id="collapse-menu" class="hide-if-no-js"><div id="collapse-button"><div></div></div>';
    +echo '<span>' . esc_html__( 'Collapse menu' ) . '</span>';
    +echo '</li>';


Topic Closed

This topic has been closed to new replies.

About this Topic