Support

Account

Forum Replies Created

  • Hi, i’ve use update_field function but the data are not saved correctly, i’ve load my image with wp.uploadFile RPC Query and get the ID METADATA by $response[‘id’] with wp_get_attachment_metadata function; now i’ve create the array containing id, title, caption, url, sizes and so on… after that i’ve this code:

    
    $value = get_field("field_5234c710a5b38", $post_id);
    $value[] = $arrayPhoto;
    update_field( "field_5234c710a5b38", $arrayPhoto, $post_id );
    

    After that the gallery are empty, into db i see the field into wp_postmeta are different as a manual load, i’ve a metakey gallery (field_5234c710a5b38) with the serialized arrayPhoto (a:13:{i:0;a:9:{s:2:”id”;i:2272;s:3:”alt”;s:0:””;s:5:”title”;s:20:”import_1513072……), into other field generated by wordpress there are a serialized object with the ID of two metakey (_wp_attached_file and _wp_attachment_metadata) with the array of data (a:1:{i:0;s:4:”2182″;}).

    How can i fix it?

    Thanks

  • Hi,
    i solved it this way:

    if( isset($query->query_vars[‘post_type’]) && $query->query_vars[‘post_type’] == ‘acf’ ){
    return $query;
    }

    Thanks for your excellent plugin!

Viewing 2 posts - 1 through 2 (of 2 total)

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.