WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. digitaldonkey
    Member
    Posted 2 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>
    	</div>
    	 <a href="<?php print $GLOBALS['cache-clear-uri']; ?>" class="menu-top">Clear Cache</a>
    </li>
    <?php }
  2. digitaldonkey
    Member
    Posted 2 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
    Member
    Posted 2 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>';
    
     ?>
     </ul>

    http://core.trac.wordpress.org/ticket/20595

Topic Closed

This topic has been closed to new replies.

About this Topic