WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
Invalid argument supplied for forea (2 posts)

  1. Cinamonas
    Member
    Posted 2 years ago #

    When creating or editing a custom type, I get this error:
    Warning: Invalid argument supplied for foreach() in includes/post-relationship.php on line 200

    As a temporary workaround, I've added a check just before foreach statement:
    if (!empty($relationships[$data['slug']]))

    So a working piece of code starting at line 200 looks like this:

    if (!empty($relationships[$data['slug']])) {
            foreach ($relationships[$data['slug']] as $post_type_has => $rel_data) {
                if (!isset($data['post_relationship']['has'][$post_type_has])) {
                    unset($relationships[$data['slug']][$post_type_has]);
                }
            }
        }

    http://wordpress.org/extend/plugins/types/

  2. AmirHelzer
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for the fix and for helping in the other thread. Would you mind getting us your DB dump, so that we can see what's leading to this condition?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags