WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
[resolved] PHP Warning in 'core/fields/checkbox.php' (8 posts)

  1. Doggie52
    Member
    Posted 2 years ago #

    Thank you for a great plugin. I am getting a PHP warning at every site load looking like this:
    [24-Jan-2012 15:57:46] PHP Warning: in_array() expects parameter 2 to be array, string given in /wp-content/plugins/advanced-custom-fields/core/fields/checkbox.php on line 58

    Do you know a solution to this problem? Am I causing it by some malconfiguration of my fields?

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. jcow
    Member
    Posted 2 years ago #

    This is a problem for me too... I just installed the plugin and an immediate error... Not feeling good about this plugin.

  3. jcow
    Member
    Posted 2 years ago #

    Updated in latest version.

  4. Michael Cannon
    Member
    Posted 2 years ago #

    @jcow - not quite fixed. For multiple values you're solid, but for single, nope.

    My fix suggestion in core/fields/checkbox.php, line 40, add the following.

    // single values need array conversion
            if(!is_array($field['value'])) $field['value'] = array($field['value']);

    Ciao!

    Michael

  5. Michael Cannon
    Member
    Posted 2 years ago #

    @jcow, this is in regards to 3.1.7.

  6. Michael Cannon
    Member
    Posted 2 years ago #

    Checkbox and radio checking, is still a problem with 3.2.0 for clients.

    core/fields/checkbox.php, line 40, below the if(empty…
    if(!is_array($field['value'])) $field['value'] = array($field['value']);

  7. elliotcondon
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks Michael

    I'll add this in!

    Cheers
    E

  8. Michael Cannon
    Member
    Posted 2 years ago #

    Danke, 謝謝,thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic