WordPress.org

Ready to get started?Download WordPress

Forums

Ultimate Post Type Manager
Invalid argument supplied for foreach() in (6 posts)

  1. Bainternet
    Member
    Posted 2 years ago #

    running version 1.6.9 of your plugin
    when no custom post types are defined gives:

    Warning: Invalid argument supplied for foreach() in ...\www\httpdocs\wp\wp-content\plugins\ultimate-post-type-manager\index.php on line 381

    and a very simple fix to that is on line 381 where it says
    foreach($cpts as $cpt)
    it should be
    foreach((array)$cpts as $cpt)

    or you can check the count of $cpts before calling the foreach and if its 0 then skip it.

    http://wordpress.org/extend/plugins/ultimate-post-type-manager/

  2. flashpunk
    Member
    Posted 2 years ago #

    I'm seeing this too,
    however after I applied your fix, I am now unable to access the plugin page.

    Is there any other fix I can apply?

  3. Bainternet
    Member
    Posted 2 years ago #

    you probably done something wrong since it has no effect on the plugin page.

    anyway i posted the other solution above:

    or you can check the count of $cpts before calling the foreach and if its 0 then skip it.

  4. flashpunk
    Member
    Posted 2 years ago #

    Tried it again, blank page.

    Here's a screenshot. http://twitpic.com/7zbggc

  5. Bainternet
    Member
    Posted 2 years ago #

    from that screenshot it looks like you are missing an opening { at the end of that line it should say:

    foreach((array)$cpts as $cpt){

  6. y13hard
    Member
    Posted 2 years ago #

    Thanks man.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic