Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • @ozh:
    I will do my best soon, if no one fixed it yet.

    @snih:
    i didn’t notice it on the first time, to fix this problem you have to override admin area css, and it can’t be set as inline style because “before” is a pseudo-class and it’s not possible to create inline styles for it.

    so, a temporary solution is to hook on “admin_head” action , by adding the following in your theme “functions.php” file

    add_action('admin_head', 'custom_css');
    
    function custom_css() {
      echo '<style>
        div.wp-menu-image:before  {
          padding:4px 0 !important;
        }
      </style>';
    }

    you can change 4px to any value between 0-7 that you see it fits well with you ??

    hope this help!

    @spherical
    that’s weird ! , i got the class name from the native wordpress styling for menu items
    if you have a normal dashboard without Ozh plugin and inspected the menu items code you will find that wordpress uses class “dashicons-before” !

    hello all

    this is a temporary solution that will display the new Dashicons set instead of empty icons

    – open the plugin directory and edit the file in that path inc/core.php , starting from line 85 you will find this part of code

    if ( isset($item[6]) && ! empty($item[6]) ) {
    			if ( 'none' === $item[6] || 'div' === $item[6] )
    				$img = '<div '.$imgstyle.' class="wp-menu-image"><br /></div>';
    			else
    				$img = '<img '.$imgstyle.' class="wp-menu-image" src="' . $item[6] . '" alt="" />';
    		}

    just replace it with the following code

    if ( isset($item[6]) && ! empty($item[6]) ) {
    			preg_match('/^dashicons/', $item[6], $matches);
    			if ( 'none' === $item[6] || 'div' === $item[6] )
    				$img = '<div '.$imgstyle.' class="wp-menu-image"><br /></div>';
    			elseif (!empty($matches))
    				$img = '<div '.$imgstyle.' class="wp-menu-image dashicons-before '.$item[6].'"><br /></div>';
    			else
    				$img = '<img '.$imgstyle.' class="wp-menu-image" src="' . $item[6] . '" alt="" />';
    		}

    i tried to keep the orginal code of the plugin away of modifications , i just added a new condition that look for “dashicons” and then it will alter the div classes with the needed icon class

    hope this help

    i don’t know if you are still need the solution , it’s 2 months ago ??

    but i were facing same problem and found that the wordpress reserve the variable ( name ) , check -> Reserved Terms

    so the solution is hard-code one you have to change the code on the plugin files of
    $_REQUEST[name] to another name that not reserved by wordpress like $_REQUEST[cname]
    and ofcourse use this new name on your query

    Thread Starter Muhammad Mahmoud

    (@hawyphp)

    @michaelh

    Thanks for your attention .. but this plug wasnt to get what i mean

    @ Scribu

    Thanks for your reply .. it’s similar to vtxyzzy’s idea

    i asked PHP Web Developer .. his name is Burak Guzel [phpandstuff.com]

    and he helped me that i can make index(non-unique) to the field with a specific length even it’s type is TEXT

    e.g. i will index the first 20 charachters from this field
    –>
    alter table wp_postmeta ADD INDEX ( meta_value ( 20 ) )

    Thanks 4 All

    Thread Starter Muhammad Mahmoud

    (@hawyphp)

    it’s right
    but is there any simpler solution ?

Viewing 6 replies - 1 through 6 (of 6 total)