This link to the WordPress Codex should help. It demonstrates a few different ways to POST using AJAX in a plugin. As for re-arranging your listed elements, this can be done a number of ways.
I would recommend running a search for rearranging elements using javascript. The jQuery function .insertBefore()
and .insertAfter()
can be used to drag/drop elements. For example, the following code can be used to move an element above the previous element:
$("p").click(function() {
$(this).insertBefore($(this).prev());
});
or even something like this just to manually move a paragraph above the other:
<p id="1"></p>
<p id="2"></p>
<!--javascript-->
<script type="text/javascript">
$('#2').insertBefore('#1');
</script>
It’s hard to help out much more without any further information.
Related Posts:
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- JavaScript implementation of Gzip
- How to cache json with wp-super cache
- WordPress AJAX with Axios
- Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
- Get Previous & Next posts by Post ID
- Nonces and Cache
- REST API endpoint for elasticpress autosuggest
- ajax – why multiple calls to wp_create_nonce() return same value?
- AJAX request on the frontend always returns 0 if user is not admin
- Using ajax on categories and wordpress loops
- Cannot load admin-ajax.php. No access-control allow origin*
- How to modify wp_ajax function?
- Nonces and Ajax request to REST API and verification
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php
- Can’t seem to get wp_localize_script to work
- Ajax – gettext without a plugin
- WordPress AJAX calls not detecting language properly?
- AJAX issue – Uncaught SyntaxError when processing Zip File
- wp_verify_nonce doesn’t return true on server when it matches the nonce
- update_user_meta doesn’t work with AJAX
- Ajax stops working when logged in?
- WordPress ajax get content post id
- Using wp_handle_upload and media_handle_sideload with ajax
- Create Page With wp_insert_post() and AJAX
- Load ajax if is_home()
- How to know what page is calling admin-ajax.php?
- Populate a Map at The Same Time as showing Posts via AJAX
- wp_localize_script not working on ajax response
- Get wp_title wp ajax
- Why Does WordPress not output admin-ajax.php path by default?
- Ajax custom search not functioning as expected
- Jetpack Infinite Scroll – Add more than 7 posts each time?
- SSO autologin WordPress + Ajax
- Speed/Performance difference between `wp_ajax` and `init` checks for AJAX/POST requests?
- Test WordPress api with postman
- Remove trailing 0 from function that is used both statically and dynamically
- How to process wordpress ajax call without action parameter?
- How to load next and previous posts by Ajax
- Update attachment metadata fails
- Nonce fails on ajax save
- WordPress ajax works on FF but not on IE & chrome
- Disallow second login session
- WordPress P2 live problem
- All AJAX requests return a 400 error
- Unable to successfully verify nonce
- Create custom POST Method URL
- POST Ajax bad request
- Getting a variable using $post ajax back from php to js response in WP
- AJAX Call – Failed to load resource: the server responded with a status of 500 (Internal Server Error)
- WordPress is Not Setting PHP $_POST on Custom Ajax
- bulk update meta value with ajax
- javascript ajax and nonce
- Is it possible to determine whether a page is a page template by page_id in ajax call?
- Chained ajax call, second call returns 0
- How to create a form button that executes a function?
- How to stop being directed to admin.php after sending request to admin-ajax.php
- Distinguish between 2 instances of admin-ajax.php
- How to update post with Ajax (no plugin)
- Including ‘wp-load.php’ after another include() generates an error
- How to make pages that arent indexed for ajax applications
- Why does reCAPTCHA v3 return 0 ? In custom AJAX registration form
- admin-ajax.php 400 bad request
- edit user input data contact form 7
- WordPress POST AJAX call, var_dump($_POST) NULL and AJAX response empty when inside ob_start
- Set cors header for ajax requests
- Simple AJAX code that refreshes every x seconds?
- How to keep scripts persistent during admin-ajax process when saving widget?
- Very weird bug: Ajax for non-admins
- Search function – problem with whole words
- jQuery ajax method does not return data
- WordPress 403 error on form submission with Ajax
- I am getting Admin-ajax.php 400 Error
- Ajax and get_template_part
- Ajax is not defined
- Get posts by category via ajax
- How to require files in a custom endpoint
- Load oEmbed iframe within ajax call
- Adding pagination to Ajax Query
- WordPress 4.9.6 – IncludeMe & getAjax GET using wrong URL
- Get post details with pure javascript ajax
- WorddPress website admin part not working correctly – I think ajax/json issue
- check_admin_referer fails on new AJAX plugin uninstall with “Are you sure you want to do this?”
- Ajax Security regarding user priviliges and nonces
- How to populate data from JSON using AJAX in TypeScript? [closed]
- Use ajax without a plugin?
- Weird admin-ajax.php problem
- Ajax contact form returnig 0
- Know which script/page is being called by ajax call
- Trying to send AJAX data to WordPress hook
- wp_enqueue_media problem
- Update user meta using Ajax on front end?
- retrieving page content per AJAX [duplicate]
- Posting to loop.php file
- Can’t access data from database using AJAX
- Facebook Pixel + WooCommerce + AJAX = Confusion
- Front-end ajax problem all users and guests getting a 302 redirect when accessing wp-admin/admin-ajax.php
- Use Ajax to get an Options Settings Value
- Run PHPMailer function after ajax function completes that adds row to custom table