Support » Plugin: Ultimate Post Type Manager » [Plugin: Ultimate Post Type Manager] Invalid argument supplied for foreach() in

  • 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/

Viewing 5 replies - 1 through 5 (of 5 total)
  • flashpunk

    (@flashpunk)

    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?

    Bainternet

    (@bainternet)

    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.

    flashpunk

    (@flashpunk)

    Tried it again, blank page.

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

    Bainternet

    (@bainternet)

    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){

    y13hard

    (@y13hard)

    Thanks man.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Ultimate Post Type Manager] Invalid argument supplied for foreach() in’ is closed to new replies.