• Resolved onlycj

    (@onlycj)


    I have more than 30 acf in my post. Then i make import by existing posts they totally rewrite, but i need to update only not null values.
    Help me please!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @onlycj

    i need to update only not null values

    You would need to write some custom code and use our API to do this. You’ll find information on our “pmxi_acf_custom_field” hook and an example snippet that you can adjust as per your needs here: https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-import/pmxi_acf_custom_field.php.

    subbotaanton

    (@subbotaanton)

    Hi @wpallimport !

    I tried to use this approach, but it looks like a post is modified before this hook.

    When I execute $existing = get_post_meta( $pid, $name, true ); in wp_all_import_pmxi_acf_custom_field, it always gives me empty values, and in my opinion it happens because of wrong order of execution the hook and changing a post.

    PS If I try to get meta from another post in the same hook, it works fine, so no debt about get_post_meta.

    1

    2

    3

    • This reply was modified 8 years ago by subbotaanton. Reason: added screenshots
    subbotaanton

    (@subbotaanton)

    PPS Fixed: “When I execute $existing = get_post_meta( $pid, $name, true ); in pmxi_acf_custom_field hook”

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Import only not null values’ is closed to new replies.