Skip to content

Commit df83303

Browse files
committed
Return whether the action succeeded from the create_table function
1 parent fc78751 commit df83303

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: php/class-db.php

+8-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ function create_table( $table_name ) {
135135

136136
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
137137
dbDelta( $sql );
138-
do_action( 'code_snippets/create_table', $table_name );
138+
139+
$success = empty( $wpdb->last_error );
140+
141+
if ( $success ) {
142+
do_action( 'code_snippets/create_table', $table_name );
143+
}
144+
145+
return $success;
139146
}
140147
}

0 commit comments

Comments
 (0)