Ajax - The core of WordPress uses Ajax only in the administration screens. For instance, Ajax is used for instant updates when you are doing comment moderation, and when you are adding and deleting items from lists such as categories, blogroll, and posts; Ajax is also the technology behind the ...

learn more… | top users | synonyms

1
vote
1answer
43 views

How can I inject options into an select tag inside the widget form?

I created a widget, that retrieves filenames from the database and am now trying to output the filenames as options in a select tag inside the admin widget menu(the form function in the widget class). ...
0
votes
1answer
20 views

Why is the form not updating when I select a new sector from the list?

Im trying to fix a form on http://s195004125.websitehome.co.uk/jobs/ for some reason the sector selection box doesnt update the list below when a change ios made but it changes when you select a ...
0
votes
1answer
103 views

$_POST empty in using new php file added to theme

I am using a theme which handles form data with jquery (a handler function defined).I have added a new php file to theme (using it in as template in a wordpress page, also registered with rewrite ...
1
vote
1answer
148 views

AJAX nonce with check_ajax_referer()

I want to use check_ajax_referer() to verify a WP_nonce field using AJAX. Here you can find my html element. <input type="hidden" name="login_nonce" value="<?= wp_create_nonce('login_nonce'); ...
0
votes
1answer
80 views

admin-ajax.php GET custom-post titles

I can't get the titles of my custom post. this is what i'm doing: //IN functions.php function fluid_scripts() { wp_enqueue_script('lateral-fluid', ...
0
votes
0answers
174 views

Pagination for ajax category filter

I created an AJAX category filter for a custom post type with custom taxonomy. 1)It's working but can't figure out how to add pagination for the custom taxonomy once it filters. When I click on ...
0
votes
1answer
26 views

WordPress Feedback popup with date saved into table

Spending now more then 2 days of searching and testing all kind of plugins, I need some help. I need a Feedback popup plugin with these tasks: front-end pop-up with main question + text area for ...
1
vote
0answers
69 views

How do I pass the id of my widget to javascript in the form function?

I would like to add a Quilljs editor to the admin area of my widget, but I am having trouble passing $this->id to javascript. I am using the foo_example widget code, and I've appended the ...
0
votes
0answers
55 views

AJAX - nonce verification fails

I have a simple add-to-newsletter widge. I created a hidden input with nonce: $nlnonce = wp_create_nonce("add-newsletter"); echo '<input type="hidden" id="nlnonce" value="'.$nlnonce.'" />'; ...
1
vote
0answers
69 views

Init plugin again after ajax call finish

We have this website that the navigation between pages work with ajax. in the blog page we use this great plugin to make the ajax load-more posts. all works great but the problem is that when you ...
2
votes
1answer
62 views

Comparing arrays within a loop

I am trying to write a save search function, where the user can save their searches, but I need some help in checking if the search is already in the database for the current user making the search. I ...
2
votes
1answer
233 views

Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]

What I eventually want to do is when user logged-in to the site, I want to redirect the to the page with all the post created by that user and I want to load them via AJAX request. I have save ...
0
votes
1answer
1k views

Woocommerce Ajax Add cart not working

In woocommerce ajax add to cart method not adding when cart is empty, if cart contains something then my ajax function adds but if cart is empty it doesn't add. And no error. Here is the link. PHP ...
0
votes
0answers
522 views

Insert data into mysql database with php and ajax

I made admin menu inside wordpress and I have form that allows admin to insert some values. I have html: <form id="prices_form" method="post" action=""> <div ...
0
votes
0answers
333 views

Ajax - Post Categories and Load More

I have a page_template on my front page where I want to show "all post category" by default with a maximum of 5 post, but there will be buttons for each of my category, so when they click on a ...
0
votes
0answers
38 views

Server side validation on AJAX form submit from front-end

My current server side validation is not working with AJAX submit. // Tracking error messages function write_here_errors(){ static $wp_error; // Will hold global variable safely return ...
0
votes
1answer
258 views

admin-ajax.php returns 0. How do I debug it and fix it?

Trying to use admin-ajax.php to upload image from front-end form. I'm keep getting 0 with below code I have and not sure how to debug this or where it goes wrong. I have HTML input file <input ...
0
votes
0answers
29 views

ajax pull and show how to show custom fields?

hi guys I have this code is part of essential grid, a plugin to show content. im trying to customise the ajax view of the plugin, that opens posts via ajax request. case ...
0
votes
1answer
252 views

Live search from database table

I have wordpress site. I made custom table and sotred values in one row. Now I made admin menu and added input field into it. <input id="location1" type="text" /> I need to predict search ...
0
votes
1answer
25 views

Can't retrieve any content from Ajax-loaded page

Once my_file.php is loaded through Ajax I can't get any WordPress content from it, even though Wordpress functions run without generating any error messages. Note that I'm doing Ajax the old school ...
0
votes
0answers
35 views

Ajax Wordpress: Load post title and custom fields

I'm customizing the Ajax output of Essential Grid Plugin that by default only shows the post_content. I need to show the_title and several custom fields. How can I achieve this by modifying the below ...
0
votes
0answers
11 views

Make youtube and vimeo videos work with ajax? [duplicate]

I have some videos , the url pasted in the content. the video displays fine but not when loaded via ajax, i just see the url. how can I fix this problem so youtube and vimeo videos render like ...
0
votes
2answers
91 views

How to get those data using with ajax json?

The following coding is the out come of an other page php echo user_list.php: $myarray=array(); ... ... $myjson = json_encode($myarray); echo $myuser->searchUser($myjson); and the result of ...
0
votes
0answers
237 views

AJAX image upload with a upload progress bar using media_handle_upload

I currently have post image upload for the featured image from front-end form. <input type="file" name="wh_image_upload" id="wh_image_upload" multiple="false" /> and using media_handle_upload ...
0
votes
1answer
86 views

WP Cron as Fast as WordPress AJAX?

I have a question about performing a very long and resource intensive task within WordPress. Here is the scenario. I have a plugin that allows users to run a task that takes a very long time and ...
0
votes
0answers
17 views

How to limit each front-end user to view just his own uploaded files on Amazon S3?

In my Wordpress website Users can upload video files directly to a Amazon S3 bucket, all of them use the SAME bucket for their uploads. After the upload is done each user should be able to view/delete ...
0
votes
1answer
26 views

Not getting result using ajax on wordpress

I have used the following code on my functions.php page add_action('woocommerce_product_thumbnails', 'my_ajax_button'); function my_ajax_button() { echo '<button class="buy-this-room myajax" ...
0
votes
1answer
241 views

Ajax image upload with media_handle_upload and form.js

I want to have AJAX image upload on front-end form and can't figure out where it goes wrong. HTML form for image upload <form id="thumbnail_upload" method="post" action="#" ...
0
votes
1answer
470 views

Processing ajax call to php to insert into mysql database

I made top menu in wp admin dashboard. There I will have input field. It will be input where admin can enter Google locations. After picking correct location admin will press save and location will be ...
-2
votes
1answer
30 views

How to make a rest style plugin?

I created a plugin that is basically a crud to write to the mysql database. I want to know how to display the data on a wordpress page. I'm reading about url rewrites but it seems rewrites are for ...
0
votes
0answers
77 views

Trying to update User Meta with Ajax

I am trying to make a plugin to record the users browser based location as user meta data stored as Latitude and Longitude. This current version is trying to make user meta via form, but ultimately I ...
0
votes
2answers
44 views

Ajax call URL 404'ing when pushed to staging server

I have AJAX form submission working fine locally. But when pushed to my staging server the process page is 404'ing. I cannot access it directly neither as it 404's but checking on the server and its ...
0
votes
1answer
105 views

AJAX and do_shortcode

I know questions on this subject have been asked before. But I'm stuck and cannot find a way out. I am using Ajax to load external information to my site. Initially all the information was loaded at ...
0
votes
0answers
28 views

What is the best way to handle Ajax image upload on front end?

I have been searching around for awhile but haven't found a solution yet. For this question, I like to get some general answers or resources for implementing AJAX image upload in front-end form. ...
0
votes
1answer
81 views

Autocomplete for titles via ajax - rework of past post away from like_escape()

I'm trying to create an input field that can autocomplete only title from a CPT. They don't have to be linked, they just need to pull titles of a cpt alphabetically and searching from the first ...
0
votes
1answer
159 views

wp_ajax action is not run when ajax trigger

I'm trying to implement the ajax in wordpress world but now stuck. Function hook suppose to be called when ajax triggered is not happening. I check the network admin-ajax.php is called but ...
0
votes
0answers
60 views

AJAX and Genesis Framework

On the website I am building, I have made 4 WordPress pages. I have a jQuery script which adds classes on certain divs when a user clicks on the links in the navbar. Obviously this is not working ...
0
votes
0answers
64 views

Load More CPT’s with Ajax?

I am using the following tutorial to load the next range of posts. I am however, trying to adapt to use it with Custom Post Types and not having much luck. This is the default code.. function ...
0
votes
0answers
40 views

add_order_item from custom endpoint

Im useing WP>Woocommerce->Woocommerce subscriptions I have created a custom endpoint: /edit-subscription/. You can see exactly what i did in the last comment here: ...
0
votes
1answer
55 views

AJAX Post from same domain to a wordpress page

I am trying to create an ajax post listener to a wordpress page in a domain (let's just say http://example.com). Another web app in the same domain (http://example.com) exists and a user sends ajax ...
0
votes
0answers
35 views

ajax and nonce when js is in a seperate file

I'm a little confused how nonces work with ajax requests. It looks like I use this: https://codex.wordpress.org/Function_Reference/check_ajax_referer So it looks like your request is: <?php //Set ...
0
votes
0answers
50 views

Display the post on page scroll and auto update URL

I have to create a page template on which I can show all the posts by category when scrolling down the page; here is an example. My theme index page code is: do_action( 'st_theme_init' ); ...
0
votes
1answer
59 views

PHP Warning: Missing argument 2

From ajax Im updating a custom user field and visualising proper content using a shortcode. localising jquery function localise_jquery1410() { wp_enqueue_script('jquery'); wp_enqueue_script( ...
0
votes
0answers
35 views

Run query with meta key via AJAX

I'm completely new to AJAX, and I can't seem to find anything that's pointing me in the right direction. I have a table that contains one row for each post in a post type. Each row contains the posts ...
0
votes
2answers
252 views

Wordpress Ajax JSON success return no being recognized

I'm working on a contact form for a website using an jQuery Ajax call method that then uses Wordpress's building in admin-ajax.php to submit the form's values, send them to an email address via ...
0
votes
1answer
986 views

WP-API and Basic Auth returning 403 on POST but not GET

I am using the latest, WP-API and the recommended Basic Auth, to test adding a post to WP from remote. I have Access Headers opened up on the WP side: header("Access-Control-Allow-Origin: *"); ...
0
votes
1answer
51 views

How to fetch meta_value and meta_key in matrix after ajax request by post_id

Well, I have 2 custom post types: A = Properties B = Property Owners Inside CPT Properties, I was created a Meta Box to: Search a registred Owner (CPT) by VAT number (CPF in Brazil) Relate Owner ...
-1
votes
1answer
283 views

Facebook Pixel + WooCommerce + AJAX = Confusion

I am trying to add a Facebook Pixel (tracking) to the WooCommerce Add to Cart button, using: <script> fbq('track', 'AddToCart'); </script> The problem is that when a user clicks on Add ...
0
votes
0answers
263 views

Load custom post type posts using AJAX on static front page[custom query loop]

I am using following custom query loop to load 'portfolio-item' type posts on static front page. The loop is working great with custom numbered pagination but I want to convert it to AJAX call and ...
0
votes
1answer
117 views

Update Data parameter of a wp_localize_script() call

I'm working on a child theme, In my-page-template.php I have : //... $current_key= 5; //calculated result wp_localize_script('my_js', 'ajaxload', array('post_id' => $current_key)); In my_js.js ...