• Resolved beng56

    (@beng56)


    Hi,

    I’m using AutomatorWP in order to populate ACF meta fields in a post after an event is triggered. I wanted THEN to run some PHP with the ‘acf/save_post’ filter once those fields are updated. But it looks like it cannot trigger this filter. If I update the same fields manually in the post, my code runs. Is there a way to trigger when an AutomatorWP action runs maybe, and why my ‘acf/save_post’ filter isn’t working ?
    I was thinking about filter priority but it didn’t changed anything.

    Any help?

    Thanks for your support,

    Benoit

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Paco González Pérez

    (@pacogon)

    Hi @beng56!!

    ACF saves the fields in the post meta, so you can use the “Post meta gets update” trigger to detect when a field is updated.

    Regarding the code, in AutomatorWP code you have many triggers and actions as example, in this way you can build yourself the triggers and actions of your choice.

    Hope it helps!

    Thread Starter beng56

    (@beng56)

    Hi,

    It worked for a part of my code, but not everything. Indeed, I need to access user data, but also from another user than the one making the ACF update. I can access to user data with AutomatorWP but not someone else, even though I have access to his email for example.

    It didn’t solve completely my issue. I guess, if there is not way to run my code, I will have to add some user data inside the post meta ..

    Beno?t

    • This reply was modified 3 years, 8 months ago by beng56.
    Thread Starter beng56

    (@beng56)

    Hi again,

    I don’t know why it didn’t work with the other hooks I was using (acf/save_post or wp_insert_post), but by using the following hooks :

    add_action( ‘added_post_meta’, ‘wp_afterpostmeta’, 10, 4 );
    add_action( ‘updated_post_meta’, ‘wp_afterpostmeta’, 10, 4 );

    I managed to trigger my code.
    You can close the ticket ??

    Best,

    Benoit

    Plugin Contributor Paco González Pérez

    (@pacogon)

    Hi @beng56 !

    I’m glad you were able to solve it.

    If you have any other questions, do not hesitate to contact us.

    ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘acf/save_post with AutomatorWP’ is closed to new replies.