Skip to content

Instantly share code, notes, and snippets.

@moxet
Created August 23, 2024 05:12
Show Gist options
  • Save moxet/fdce45464c9564f45b31b268d9e72eee to your computer and use it in GitHub Desktop.
Save moxet/fdce45464c9564f45b31b268d9e72eee to your computer and use it in GitHub Desktop.
Change CCT Author
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