Title: Creating default object from empty value
Last modified: August 24, 2016

---

# Creating default object from empty value

 *  [haveboard](https://wordpress.org/support/users/haveboard/)
 * (@haveboard)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value-9/)
 * I am getting the following warning:
    Warning: Creating default object from empty
   value in wp-content/plugins/current-menu-item-for-custom-post-types/include/filter.
   php on line 32
 * I updated lines 32 and 33 to make sure the object is even set and it removes 
   the warning but Im not 100% that this is the correct solution
 *     ```
       if( isset($cmicptClass->item) && empty( $cmicptClass->item ) ) $cmicptClass->item = "current-menu-item";
           if( isset($cmicptClass->parent) && empty( $cmicptClass->parent ) ) $cmicptClass->parent = "current-menu-ancestor";
       ```
   
 * [https://wordpress.org/plugins/current-menu-item-for-custom-post-types/](https://wordpress.org/plugins/current-menu-item-for-custom-post-types/)

The topic ‘Creating default object from empty value’ is closed to new replies.

 * ![](https://ps.w.org/current-menu-item-for-custom-post-types/assets/icon-128x128.
   png?rev=1915898)
 * [Current Menu Item for Custom Post Types](https://wordpress.org/plugins/current-menu-item-for-custom-post-types/)
 * [Support Threads](https://wordpress.org/support/plugin/current-menu-item-for-custom-post-types/)
 * [Active Topics](https://wordpress.org/support/plugin/current-menu-item-for-custom-post-types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/current-menu-item-for-custom-post-types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/current-menu-item-for-custom-post-types/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [haveboard](https://wordpress.org/support/users/haveboard/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/creating-default-object-from-empty-value-9/)
 * Status: not resolved