I am trying to: auto-increment a field named COUNT in my CPT Issues
I'm using this function:
add_action('cred_save_data', 'increase_custom_value',10,2);
function increase_custom_value($post_id, $form_data)
{
//NOTE: Set your form ID instead of 12
if ($form_data['id']==2775)
{
//Get count field from database and add 1
$count = intval(get_post_meta( $post_id, 'wpcf-count', TRUE )) +1;
//Update count field
update_post_meta($post_id, 'wpcf-count', $count);
}
}
With a CRED form id=2775. I have ajax DISabled.
The field COUNT is numeric.
I just want every new record to get a value in "COUNT" that is the value of COUNT of the last record + 1.
The field keeps getting updated with the same number, "1".
*post edited* I have disabled all plugins but Toolset:
CRED
Types
Views
MAPS
And the problem still exists.
I still would like help with this.
Hi, I'm terribly sorry for the delay in response. This is not normal - for some reason none of the support team members were informed of this ticket until just now. I believe there is a problem in the queue and I have notified my manager of the situation. We will investigate that issue as soon as possible. It looks like another ticket related to this issue was already closed, so please let me know if you need any additional assistance here.
Thanks for acknowledging that this ticket was not answered. I did get it answered by opening another ticket with the same information.