| @@ -31,9 +31,9 @@ | ||
| 31 | 31 | $this->process_bulk_action(); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function column_default( $item, $column_name ) { |
| 35 | - return $item[ $column_name ]; | |
| 35 | + return $item[ $column_name ]; | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | // phpcs:disable WordPress.Security.NonceVerification.Recommended |
| 39 | 39 | public function search_box( $text, $input_id ): void { |
| @@ -181,14 +181,9 @@ | ||
| 181 | 181 | $link = add_query_arg( [ 'id' => $value->id ], $main_link ); |
| 182 | 182 | $data[] = array( |
| 183 | 183 | 'ID' => $value->id, |
| 184 | 184 | 'title' => '<a href="' . esc_url( $link ) . '">' . esc_attr( $title ) . '</a>', |
| 185 | - 'code' => '<div class="wpie-field"> | |
| 186 | - <label class="wpie-field__label has-icon"> | |
| 187 | - <span class="has-tooltip is-pointer on-right can-copy" data-tooltip="Copy"><span class="dashicons dashicons-shortcode is-pointer" ></span></span> | |
| 188 | - <input type="text" value="[' . esc_attr( $shortcode ) . ' id=\'' . absint( $value->id ) . '\']" readonly> | |
| 189 | - </label> | |
| 190 | - </div>', | |
| 185 | + 'code' => '<input type="text" value="[' . esc_attr( $shortcode ) . ' id=\'' . absint( $value->id ) . '\']" readonly>', | |
| 191 | 186 | 'tag' => $tag, |
| 192 | 187 | 'mode' => $mode, |
| 193 | 188 | 'status' => $status, |
| 194 | 189 | ); |
| @@ -289,9 +284,9 @@ | ||
| 289 | 284 | |
| 290 | 285 | |
| 291 | 286 | public function get_bulk_actions(): array { |
| 292 | 287 | $actions = [ |
| 293 | - 'delete' => __( 'Delete', 'float-menu' ), | |
| 288 | + 'delete' => __( 'Delate', 'float-menu' ), | |
| 294 | 289 | 'activate' => __( 'Activate', 'float-menu' ), |
| 295 | 290 | 'deactivate' => __( 'Deactivate', 'float-menu' ), |
| 296 | 291 | 'test_on' => __( 'Test mode ON', 'float-menu' ), |
| 297 | 292 | 'test_off' => __( 'Test mode OFF', 'float-menu' ), |
| @@ -364,22 +359,16 @@ | ||
| 364 | 359 | } |
| 365 | 360 | } |
| 366 | 361 | |
| 367 | 362 | private function sort_data( $a, $b ): int { |
| 368 | - // If no sort, default to ID | |
| 363 | + // If no sort, default to title | |
| 369 | 364 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 370 | 365 | $orderby = ( ! empty( $_GET['orderby'] ) ) ? sanitize_text_field( wp_unslash($_GET['orderby']) ) : 'ID'; |
| 371 | - | |
| 372 | - // Only allow columns that are actually declared as sortable. | |
| 373 | - if ( ! array_key_exists( $orderby, $this->get_sortable_columns() ) ) { | |
| 374 | - $orderby = 'ID'; | |
| 375 | - } | |
| 376 | - | |
| 377 | 366 | // If no order, default to asc |
| 378 | 367 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 379 | 368 | $order = ( ! empty( $_GET['order'] ) ) ? sanitize_text_field( wp_unslash($_GET['order']) ) : 'desc'; |
| 380 | 369 | // Determine sort order |
| 381 | - $result = strnatcmp( (string) ( $a[ $orderby ] ?? '' ), (string) ( $b[ $orderby ] ?? '' ) ); | |
| 370 | + $result = strnatcmp( $a[ $orderby ], $b[ $orderby ] ); | |
| 382 | 371 | |
| 383 | 372 | // Send final sort direction to usort |
| 384 | 373 | return ( $order === 'asc' ) ? $result : - $result; |
| 385 | 374 | } |