public function getMenuIcon()
    {
        // Look for these files by default
        // If your plugin directory contains an [post-type].png file, that will by default be the icon
        // Ex: hot-sauce.png
        $reflector = new \ReflectionClass(get_called_class());
        $dir = basename(dirname($reflector->getFileName()));
        $post_type = $this->getPostType();
        $fnames = array(
            $post_type.'.png',
            $post_type.'.gif',
            $post_type.'.jpg'
        );
        foreach ($fnames as $fname) {
            $fpath = sprintf('%s/%s/%s', WP_PLUGIN_DIR, $dir, $fname);
            if (!file_exists($fpath)) {
                continue;
            }

            return sprintf('%s/%s/%s', WP_PLUGIN_URL, $dir, $fname);
        }
        return '';
    }
public function getMenuIcon()
    {
        // Look for these files by default
        // If your plugin directory contains an [post-type].png file, that will by default be the icon
        // Ex: hot-sauce.png
        $reflector = new \ReflectionClass(get_called_class());
        $dir = basename(dirname($reflector->getFileName()));
        $post_type = $this->getPostType();
        $fnames = array(
            $post_type.'.png',
            $post_type.'.gif',
            $post_type.'.jpg'
        );
        foreach ($fnames as $fname) {
            $fpath = sprintf('%s/%s/%s', WP_PLUGIN_DIR, $dir, $fname);
            if (!file_exists($fpath)) {
                continue;
            }

            return sprintf('%s/%s/%s', WP_PLUGIN_URL, $dir, $fname);
        }
        return '';
    }
public function getMenuIcon ( ) { // Look for these files by default // If your plugin directory contains an [post-type].png file, that will by default be the icon // Ex: hot-sauce.png $ reflector = new \ ReflectionClass ( get_called_class ( ) ) ; $ dir = basename ( dirname ( $ reflector -> getFileName ( ) ) ) ; $ post_type = $ this -> getPostType ( ) ; $ fnames = array ( $ post_type . '.png' , $ post_type . '.gif' , $ post_type . '.jpg' ) ; foreach ( $ fnames as $ fname ) { $ fpath = sprintf ( '%s/%s/%s' , WP_PLUGIN_DIR , $ dir , $ fname ) ; if ( ! file_exists ( $ fpath ) ) { continue ; } return sprintf ( '%s/%s/%s' , WP_PLUGIN_URL , $ dir , $ fname ) ; } return '' ; }
Get the menu icon
@return string
Get the menu icon