$_POST["ID"], "menu_order" => $_POST["weight"] ] ); exit; } ); /** * Remove a server from the list */ add_action( "wp_ajax_ass_remove_server", function() { ass_remove_server($_POST["server_id"]); } ); /** * Validates the availability of a given server */ add_action( "wp_ajax_nopriv_ass_check_server", "ass_check_server_availability" ); add_action( "wp_ajax_ass_check_server", "ass_check_server_availability" ); /** * Add the shortcode used for server checking */ add_shortcode(ASS_SERVER_STATUS_SHORTCODE, function( $atts ) { $GLOBALS["ass_shortcode_atts"] = shortcode_atts( array( 'id' => null ), $atts ); ob_start(); ass_include_template("view-servers"); return ob_get_clean(); });