Support

Account

Home Forums Bug Reports acf_extract_var() throws php warning

Unread

acf_extract_var() throws php warning

  • api-template.php has the following lines (564 and 565):

    
    $field = get_field_object( $selector, $post_id, false );
    $value = acf_extract_var( $field, 'value' );
    

    The problem is that get_field_object() can return a boolean, but acf_extract_var() doesn’t check to see if $field is actually an array, so you get:

    Warning: array_key_exists() expects parameter 2 to be array, boolean given in ...\plugins\advanced-custom-fields-pro\api\api-helpers.php on line 845

Viewing 1 post (of 1 total)

The topic ‘acf_extract_var() throws php warning’ is closed to new replies.