Tell us what you are trying to do?
Update a custom field for CPT when published/updated from Edit (custom post name) page.
Is there any documentation that you are following?
I can't find a way to do this in Types API.
I have a CPT "New Membership Forms" with a custom field, "nma-last-modified".
Here is the code I am trying to make work:
[code]
function cnsv_last_mod_date_timestamp($post_id, $post) {
$thePostType = get_post_type($post_id);
if ($thePostType == 'new-membership-form') {
$tz = date_default_timezone_set('America/Los_Angeles');
$nma_current_datetime = date("F j, Y, g:i A T");
update_post_meta($post_id, 'wpcf-nma-last-modified', $nma_current_datetime);
}
}
add_action('save_post', 'cnsv_last_mod_date_timestamp',10,2);
[/code]
First of all, thank you! I believe (and hope) this documentation you posted here will help. I was never aware with this issue of using priority 20.
Second, I have a few issues with Toolset Support pages and I am not sure whom else I should forward these to.
1. I never received an email notification that you posted a reply to this issue of mine. This is the third time (in a year or so) this has occured. Yes, I checked my spam folder, etc. In fact, I have wp-types.com whitelisted on my mailserver, so it should always put them in my Inbox.
2. The indexing mechanism for Toolset documentation seems to have some problems. The last 3 ot of 5 issues I had with Toolset (in some manner) I was not able to find the answer in the documentation using Search. Then, Support Forum Moderator was able to show me the exact documentation I needed. Why don't the keywords find the correct documentation. I am using very obvious words for searching but, they don't find the docs I need. And sometimes the search comes back with nothing found, when those words are clearly included in the doc pages.
3a. The bottom of a post in Support where I am able to write a Reply is quite ambiguous. Sometimes it makes good sense to leave a final comment to the Forum Moderator but, it does not make sense to check the "I still need assistance" radio button.
3b. If I click "My issue is resolved" radio, I should be able to rate the Forum Moderator as "GOOD" without being forced to type a comment. This is quite annoying.
Thanks again, Minesh!
I am now going to try and change my priority to 20 and hope it works.
P.S. I clicked "I still need assistance" on purpose here, just to prove my point in 3a.
I actually found that I was using the wrong slug value. The name of the CPT was "CNSV Member Profile" but, the slug was set to "members". However, I am glad I found out about using priority 20 to avoid flakiness.
1. I never received an email notification that you posted a reply to this issue of mine. This is the third time (in a year or so) this has occured. Yes, I checked my spam folder, etc. In fact, I have wp-types.com whitelisted on my mailserver, so it should always put them in my Inbox.
==> Ok - I've marked this ticket for email diagnostic and if you still not able to receive the email. Please let me know and I will ask concern person from our team to look at this issue.
2. The indexing mechanism for Toolset documentation seems to have some problems. The last 3 ot of 5 issues I had with Toolset (in some manner) I was not able to find the answer in the documentation using Search. Then, Support Forum Moderator was able to show me the exact documentation I needed. Why don't the keywords find the correct documentation. I am using very obvious words for searching but, they don't find the docs I need. And sometimes the search comes back with nothing found, when those words are clearly included in the doc pages.
==> We are constantly working on our Doc and there are lot of changes still going on and work is in progress. Still, I will forward your concern to our systems team and will get back to you with updates on it if any.
3a. The bottom of a post in Support where I am able to write a Reply is quite ambiguous. Sometimes it makes good sense to leave a final comment to the Forum Moderator but, it does not make sense to check the "I still need assistance" radio button.
==> I will again share this concern to our systems team.
3b. If I click "My issue is resolved" radio, I should be able to rate the Forum Moderator as "GOOD" without being forced to type a comment. This is quite annoying.
==> I will again share this concern to our systems team.