/** * Create a new item * * @uses "wp_ajax_plorg_create_plugin_groups" action * * @since 0.0.1 */ public function create_new_plugin_groups() { $new = Plugin_Groups_Options::create($_POST['name'], $_POST['slug']); if (is_array($new)) { wp_send_json_success($new); } else { wp_send_json_error($_POST); } }