| @@ -390,9 +390,8 @@ | ||
| 390 | 390 | $scopes = [ |
| 391 | 391 | "global" => "persistent", |
| 392 | 392 | "front-end" => "frontend", |
| 393 | 393 | "admin" => "backend", |
| 394 | - "content" => "content_php", | |
| 395 | 394 | ]; |
| 396 | 395 | |
| 397 | 396 | if ( array_key_exists( $params['scope'], $scopes ) ) { |
| 398 | 397 | $params['scope'] = $scopes[$params['scope']]; |
| @@ -622,21 +621,8 @@ | ||
| 622 | 621 | $code = ltrim( $code ); |
| 623 | 622 | } |
| 624 | 623 | |
| 625 | 624 | return $code; |
| 626 | - } | |
| 627 | - | |
| 628 | - public function delete_duplicates() { | |
| 629 | - // Delete snippets that have the same code and scope, keeping only the most recent one ( based on the updated column ) | |
| 630 | - $query = "DELETE t1 FROM $this->table_name t1 | |
| 631 | - INNER JOIN $this->table_name t2 | |
| 632 | - WHERE t1.id < t2.id | |
| 633 | - AND t1.code = t2.code | |
| 634 | - AND t1.scope = t2.scope"; | |
| 635 | - | |
| 636 | - $this->wpdb->query( $query ); | |
| 637 | - | |
| 638 | - return $this->wpdb->rows_affected; | |
| 639 | 625 | } |
| 640 | 626 | |
| 641 | 627 | #endregion |
| 642 | 628 | |