| @@ -198,9 +198,9 @@ | ||
| 198 | 198 | * @throws Exception |
| 199 | 199 | */ |
| 200 | 200 | public function add_col_table( string $name_table, string $name_col, string $type, string $after_col = '' ) { |
| 201 | 201 | if ( ! current_user_can( ADMIN_ROLE ) ) { |
| 202 | - throw new Exception( 'You don\'t have permission' ); | |
| 202 | + return false; | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $query_add = ''; |
| 206 | 206 | |
| @@ -789,9 +789,8 @@ | ||
| 789 | 789 | $data = $args['data'] ?? []; |
| 790 | 790 | $filter = $args['filter'] ?? null; |
| 791 | 791 | $table_name = $args['table_name'] ?? ''; |
| 792 | 792 | $key_auto_increment = $args['key_auto_increment'] ?? ''; |
| 793 | - $key_auto_increment = sanitize_key( $key_auto_increment ); | |
| 794 | 793 | |
| 795 | 794 | if ( empty( $data ) || ! is_array( $data ) ) { |
| 796 | 795 | throw new Exception( __( 'Data must be an array!', 'learnpress' ) . ' | ' . __FUNCTION__ ); |
| 797 | 796 | } |
| @@ -836,9 +835,9 @@ | ||
| 836 | 835 | * @return bool |
| 837 | 836 | * |
| 838 | 837 | * @throws Exception |
| 839 | 838 | * @since 4.2.9 |
| 840 | - * @version 1.0.1 | |
| 839 | + * @version 1.0.2 | |
| 841 | 840 | */ |
| 842 | 841 | public function update_data( array $args ): bool { |
| 843 | 842 | $data = $args['data'] ?? []; |
| 844 | 843 | $filter = $args['filter'] ?? null; |
| @@ -843,9 +842,8 @@ | ||
| 843 | 842 | $data = $args['data'] ?? []; |
| 844 | 843 | $filter = $args['filter'] ?? null; |
| 845 | 844 | $table_name = $args['table_name'] ?? ''; |
| 846 | 845 | $where_key = $args['where_key'] ?? ''; |
| 847 | - $where_key = sanitize_key( $where_key ); | |
| 848 | 846 | |
| 849 | 847 | /*if ( ! $filter instanceof FilterBase ) { |
| 850 | 848 | throw new Exception( __( 'Invalid filter!', 'learnpress' ) . ' | ' . __FUNCTION__ ); |
| 851 | 849 | }*/ |