PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / 0.3.8
Code Engine – PHP Snippets, AI Functions & Automation for WordPress v0.3.8
0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 0.3.8 All 32 releases
← All changes | classes/rest.php +0 -15 trunk0.3.8 View file →
@@ -162,15 +162,9 @@
162 162 'callback' => array($this, 'rest_replace'),
163 163 'permission_callback' => array($this->core, 'can_access_settings')
164 164 ));
165 165
166 - register_rest_route($this->namespace, '/snippets/delete_duplicates', array(
167 - 'methods' => 'POST',
168 - 'callback' => array($this, 'rest_delete_duplicates'),
169 - 'permission_callback' => array($this->core, 'can_access_settings')
170 - ));
171 166
172 -
173 167 // SNIPPETS ENDPOINTS
174 168 $snippets = $this->snippet->select(
175 169 null, // offset
176 170 -1, // limit
@@ -808,17 +802,8 @@
808 802 $result[] = $this->snippet->insert( $snippet );
809 803 }
810 804
811 805 return new WP_REST_Response([ 'success' => true, 'data' => $result ], 200);
812 - } catch (Exception $e) {
813 - return new WP_REST_Response( ['success' => false, 'message' => $e->getMessage() ], 500 );
814 - }
815 - }
816 -
817 - public function rest_delete_duplicates() {
818 - try {
819 - $result = $this->snippet->delete_duplicates();
820 - return new WP_REST_Response([ 'success' => true, 'data' => [ 'deleted' => $result ] ], 200);
821 806 } catch (Exception $e) {
822 807 return new WP_REST_Response( ['success' => false, 'message' => $e->getMessage() ], 500 );
823 808 }
824 809 }