Linked Questions
26 questions linked to/from What's the preferred method of writing AJAX-enabled plugins?
0
votes
1
answer
4k
views
How to handle WordPress Plugin Front-end AJAX Call [duplicate]
I'm developing a custom plugin. The plugin provides a shortcode that outputs some HTML to the front-end, wherever it is called.
For the sake of example, this HTML includes a form button and textfield....
-1
votes
1
answer
109
views
Ajax in wordpress [duplicate]
I tried to write ajax with jquery to fetch data from database butajax doesn't return any data. I put that code in header and it return the whole html content in response.
What is the code need to ...
0
votes
0
answers
16
views
Where should i put my php script for ajax implementation in wordpress? [duplicate]
I want to implement ajax on a page . i create a folder under plugins and put php page there and it works(when i gave the correct path in jquery). But when i try to call any WordPress functions it ...
7
votes
3
answers
4k
views
External page integrated into WordPress returns a 404 error
I have a script that I'd like to call via AJAX from my WordPress theme, it relies upon some core WordPress functions so I am including WordPress blog header like so:
define( 'WP_USE_THEMES', false );
...
1
vote
1
answer
5k
views
POST from jQuery to PHP
I have a form that passes field values to jQuery, which validates the fields and creates the variables being sent in data: {} in the snippet below.
$.ajax({
type: "POST",
url: "<?php ...
2
votes
1
answer
5k
views
Creating custom AJAX requests
My question pertains to where I should create an ajax function that I'd like to call from my page view.
I am using a jQuery validator on a custom form that should check the inputted zipcode against ...
1
vote
1
answer
4k
views
Calling a php file from a javascript file in wordpress
I have a simple pop up form code written in javascript. It is in js/script.js folder inside themes folder.
I am using jquery ajax method to communicate with a php file to store data in db.
The php ...
2
votes
2
answers
2k
views
Minimal WordPress load for only `get_option` to work (because ajax...)
In a plugin, I use ajax to get_option() which takes much longer than it has to because entire wp gets loaded.
How do I set things up so that it (my ajax) loads only what is needed? (get_option())
2
votes
1
answer
4k
views
Custom Wordpress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB
I'm building a little form to let users update their contact information outside of the vanilla Wordpress user management systems. I plan to use a simple CRUD setup and throw in some sanitation. I've ...
0
votes
1
answer
3k
views
No access to global variables?
In main.js, I have a script, which is sending an ajax request to script.php.
$.ajax({
type: "POST",
url: "wp-content/themes/roots/script.php",
data: registerdata,
success: function(...
0
votes
1
answer
3k
views
Using email_exists() wp function in an ajax request
I'm requesting the wordpress function if (email_exists($email)) { ... } from a file (email_check.php) via ajax. Using this function is causing a server error though.
The origin (from an input text ...
0
votes
1
answer
2k
views
AJAX wp-mysql running too slow
I have made a function of ajax, which returns all the posts starting with a particular alphabet, suppose a user clicks on letter A, then all the posts starting with letter A will be displayed, any how ...
1
vote
1
answer
2k
views
jQuery Ajax() doesn't work when the page is accessed as a WordPress template page
In one file (test_ajax.php) I have a which on change loads another page (registration_form_race_type.php) with a short message via jQuery Ajax(). It works fine when "test_ajax.php" is accessed via its ...
1
vote
1
answer
1k
views
get post attachment using ajax
I'm developing a plugin and I'm trying to get the url's from a post's attachments with ajax.
If the user is on a single.php page. After some seconds, I'm sending an Ajax request, getting all the ...
1
vote
2
answers
1k
views
how to get context information inside my funcion
What processing is done by wordpress when a page is accessed that loads all contextual information into $post and other variables? and is it possible to trigger this process manually (or simulate it) ...