If this helpful, I was able to create a custom table using toolset snippet:
Custom table:
<?php
/**
* New custom code snippet (replace this with snippet description).
*/
toolset_snippet_security_check() or die( 'Direct access is not allowed' );
// Put the code of your snippet below this comment.
global $wpdb;
$charset_collate = $wpdb->get_charset_collate();
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
//* Create the teams table
$table_name = $wpdb->prefix . 'skill_level_evaluations';
$sql = "CREATE TABLE $table_name (
evalution_id INTEGER NOT NULL AUTO_INCREMENT,
evaluation_post_type varchar(255) NOT NULL,
evalution_post_id INTEGER NOT NULL,
taxonomy_slug varchar(255) NOT NULL,
parent_term_slug varchar(255) NOT NULL,
term_slug varchar(255) NOT NULL,
skill_level_3_score INTEGER,
skill_level_4_score INTEGER,
skill_level_5_score INTEGER,
skill_level_6_score INTEGER,
requester_id bigint(20) NOT NULL,
created_at datetime NOT NULL,
PRIMARY KEY (evalution_id)
) $charset_collate;";
dbDelta( $sql );
?>
Now, I have another custom code snippet that insert the data but it seems like I can't push data when the hook is cred_submit_complete.
This is the code to insert data in the table:
$sql_1= "INSERT INTO wp_skill_level_evaluations (evalution_id, evaluation_post_type, evalution_post_id, taxonomy_slug, parent_term_slug, term_slug, skill_level_3_score, skill_level_4_score, skill_level_5_score, skill_level_6_score, requester_id, created_at) VALUES(null, 'expert-review', '$post_id', 'skill-category', '$parent_term_slug', '$term->slug', '$level_3_skill_points', '$level_4_skill_points', '$level_5_skill_points', '$level_6_skill_points', '$requester_id', '$date')";
$wpdb->query($sql_1);
Let me know if is possible using toolset custom code section. And if not, what are my options?