Snippet Category: CF Run Action

Save Entry ID as User Meta Using Run Action

add_action( 'my_text_action', 'my_test_function'); function my_test_function( $data ) { $user = get_current_user_id(); if ( $user && isset( $data[ '__entry_id' ] ) && 0 < absint( $data[ '__entry_id' ] ) ) { update_user_meta( $users, 'meta_key_name', $data[ '__entry_id' ] ) ); } }Read More


Return Error With Caldera Forms Run Action

add_filter( 'my_custom_pre_filter', 'my_custom_pre_filter' ); function my_custom_pre_filter( $data ) { if ( 'something' != $data[ 'something' ] ) { return array( 'type' => 'error', 'note' => __( 'Something is not right', 'my-text-domain' ) ); } }Read More

Run Action: Update Post

add_action( 'my_text_action', 'my_test_function'); function my_test_function( $data ) { if ( isset( $data[ 'field_id_with_meta_value' ] ) && isset( $data[ 'field_with_post_id' ] ) && 0 < absint( $data[ 'field_with_post_id' ] ) ) { update_post_meta( $data[ 'field_with_post_id' ], 'meta_key_name', strip_tags( $data[ 'field_id_with_...Read More

Call Action

Add call action processor to a form, and set its action to be "my_text_action". Then you can use this example to log form submission to an option. Read More