jjgrainger / wp-custom-post-type-class

A PHP Class for creating Wordpress Custom Post Types easily
MIT License
416 stars 114 forks source link

Issues with Menu Icons #5

Closed mishterk closed 10 years ago

mishterk commented 10 years ago

Hi mate

Very cool class, but the menu icons aren't working for me. My IDE isn't actually recognising $this->menu_icon['hover'] as available from within the set_post_icon() method.

I'm setting up the CPT like so;

$teams = new CPT(array(
                        'post_type_name' => 'grdl_team',
                        'singular'       => 'Team',
                        'plural'         => 'Teams',
                        'slug'           => 'teams'
                  ),
                  array(
                        'supports' => array('title', 'editor'),
                        'hierarchical' => false,
                        'has_archive' => true
                  ));
$teams->menu_icon('dashicons-book-alt');

The logo doesn't change in the admin and I get the following errors;

[06-Jan-2014 23:57:31 UTC] PHP Notice:  Undefined property: CPT::$menu_icon in /xxx/wp-content/themes/pds-master/library/vendor/CPT.php on line 1148
[06-Jan-2014 23:57:31 UTC] PHP Notice:  Undefined property: CPT::$menu_icon in /xxx/wp-content/themes/pds-master/library/vendor/CPT.php on line 1153
[06-Jan-2014 23:57:31 UTC] PHP Notice:  Undefined property: CPT::$menu_icon in /xxx/wp-content/themes/pds-master/library/vendor/CPT.php on line 1157
mishterk commented 10 years ago

Don't mind me... I just noticed the fix for this in the resolved issues list.