Support » Plugin: Hierarchy » Works but undefined index notice

  • If running PHP 7+, you can get an undefined index notice on line 408 of class-heirary.php.

    A better way of defining $post_types_to_hide on line 408 would be to do the following:

    /**
     *  Just create an empty array
     */
    
    $hideFromMenuFix = array();
    
    if (isset($this->settings['hidden_from_admin_menu'])) {
     $post_types_to_hide = array_intersect( $this->post_types, (array) $this->settings['hidden_from_admin_menu'] );
     } else {
     // if not set, use the blank array
     $post_types_to_hide = array_intersect( $this->post_types, (array) $hideFromMenuFix );
     }

    Hope this helps!

  • The topic ‘Works but undefined index notice’ is closed to new replies.