WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Types – Custom Fields and Custom Post Types Management] Invalid argument supplied for forea

[Plugin: Types – Custom Fields and Custom Post Types Management] Invalid argument supplied for forea

  • Cinamonas
    Member

    @cinamonas

    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/

Viewing 1 replies (of 1 total)
  • Plugin Author Amir Helzer
    Participant

    @amirhelzer

    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?

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Types – Custom Fields and Custom Post Types Management] Invalid argument supplied for forea’ is closed to new replies.