WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
[resolved] PHP Warning with WP_DEBUG On (3 posts)

  1. Zack Katz
    Member
    Posted 2 years ago #

    Warning: Invalid argument supplied for foreach() in [...]/wp-content/plugins/posts-to-posts/core/type.php on line 51

    Adding the following to the expand_fields() method on a new line fixes this PHP warning.

    private function expand_fields( $fields ) {
    	if(!is_array($fields)) { return array(); } // New code
    	foreach ( $fields as &$field_args )

    Please add this fix in the next release. Thanks!

    http://wordpress.org/extend/plugins/posts-to-posts/

  2. scribu
    Member
    Plugin Author

    Posted 2 years ago #

    Why exactly would you pass 'fields' => NON-ARRAY-VALUE to p2p_register_connection_type()?

  3. Zack Katz
    Member
    Posted 2 years ago #

    I used 'fields' => 'all', but now I realize I didn't understand what the fields argument did! Just found this doc.

    Thanks :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.