@jonathan – thanks for the help. I ran into an issue with the wordpress “save_post” action that it was running prior to the saving of all of the custom post meta fields. I wound up messing around with several other actions before trying the “acf/save_post” again and I pulled the priority 20 and now it runs as I’m expecting it too.
I also stuck a hidden value into my front end form to look for on the server side so that I know if it’s a post from the front end or not.
Thanks for all of the help!
Alan
Thanks @jonathan, I’ll give that a try in a little bit and see if that solves the issue for me.
Alan
Hi @jonathan, thanks for replying.
My action that I’m setting up looks like this:
add_action('acf/save_post', array($this, 'my_acf_save_post'), 20);
The function itself looks like:
function my_acf_save_post($post_id) {
if(get_post_type($post_id) == 'my_custom_post_type') {
$post = get_post($post_id);
$custom = get_post_custom($post_id);
$toEmail = get_bloginfo('admin_email');
$subject = 'Example Subject';
$email_body = 'Example Body Content';
$was_email_sent = wp_mail($toEmail, $subject, $email_body);
}
}
One thing I feel that I should mention is that my add_action method is being called in my plugin’s constructor.
Thanks,
Alan
Either of you find out a way to do this? I could also use this.
@kristarella did you ever find a resolution to this? I’m having the same issue currently.
Thanks,
Alan
@elemenopy: Did you ever figure anything out on this? Looking in my own database it’s most likely the format that the date is saved in. I’m seeing an example that was created in the admin page ACF form that is saved in the format (YYYYMMDD) and when the post is created through gravity forms date field, it’s saved into the wp_postmeta table in the format (MM/DD/YYYY).
I am also interested in doing this, @alysko did you come up with any resolution to this?
*Also on ACF PRO*
Thanks,
Alan
Wow, I am crazy, it’s not actually showing up on the edit page either. I believe I tested this with the standard version and it worked but I hadn’t tested this on the pro version. So I can’t see my fields while on the creation or the edit page of the user. I’m guessing I’m just using the wrong location settings.
Alan
Hi, I’m trying to use this feature also. I have a simple form group with 3 fields that I want displayed when users are being created or edited based on a specific role being chosen.
I just purchased pro the other day and 2/27/2015 and I’m on v5.1.9.1 of the pro plugin.
The fields show up successfully on edit of a user but not on role selection while creating a user.
My location rules are very simple:
– User Role is equal to Agent
No other rules, and like I said, it shows up perfectly when editing an existing user just not on creation. Please let me know if I’m doing something wrong here. Also please let me know if you need any further information.
Thanks,
Alan
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.