Created
August 23, 2024 05:12
-
-
Save moxet/fdce45464c9564f45b31b268d9e72eee to your computer and use it in GitHub Desktop.
Change CCT Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('jet-form-builder/custom-action/assign_author_cct', function( $request, $action_handler ) { | |
// Getting code value from JFB | |
$author_id = $request['customer_id']; | |
$cct_id = $request['inserted_cct_subscriptions']; | |
global $wpdb; | |
$table_name = $wpdb->prefix . 'jet_cct_subscriptions'; | |
// Prepare data for update | |
$data = array( | |
'cct_author_id' => $author_id | |
); | |
$where = array( | |
'_ID' => $cct_id, | |
); | |
// Update the record | |
$wpdb->update( $table_name, $data, $where ); | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment