Skip to content

Commit

Permalink
Return whether the action succeeded from the create_table function
Browse files Browse the repository at this point in the history
  • Loading branch information
sheabunge committed Sep 19, 2017
1 parent fc78751 commit df83303
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion php/class-db.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ function create_table( $table_name ) {

require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta( $sql );
do_action( 'code_snippets/create_table', $table_name );

$success = empty( $wpdb->last_error );

if ( $success ) {
do_action( 'code_snippets/create_table', $table_name );
}

return $success;
}
}

0 comments on commit df83303

Please sign in to comment.