0
votes
0answers
12 views

AJAX doesn't pass variables to the php function in the plugin

I'm creating a plugin that at a certain point has to use AJAX to pass information to php depending on the events fired by front end user on the different page. The event itself is when the user ...
0
votes
0answers
52 views

Attaching images on frontend with AJAX to show thumbnails before submitting form

I currently have a frontend post upload form working so that users can add thumbnail attachments to a post, however it isn't possible to see which thumbnails you have attached before you submit the ...
1
vote
1answer
121 views

Help with AJAX front end comment moderation

I am implementing a front end AJAX comment moderation system for a site I manage but I am having a hard time getting it to work. Right now clicking on the link that approves the comment runs the ...
0
votes
0answers
16 views

How to use ajax_url in front end when using with theme? [duplicate]

I'm trying to use ajax function to my theme. I think i can't just put the javascript code in my functions.php, i have to register it properly and enqueue it. So i store the javascript file with .js ...
0
votes
2answers
259 views

Ajax functions - no access to wp-admin.php only online

I'm having some trouble with my custom ajax function. I have this on my console log : "POST MYSITEURL/wp-admin/admin-ajax.php 302 Found". So my functions won't work... And I really don't understand ...
0
votes
1answer
52 views

Using AJAX with Forms

I am attempting to validate and submit a form using AJAX in WordPress, however, the response that I am getting is 0. According to the codex, this would seem to indicate that admin-ajax is unable to ...
0
votes
1answer
334 views

Three level taxonomy dropdown frontend

I have a code in my functions.php to display 3-level taxonomy dropdown: $brand_taxonomy = 'county'; $taxonomy_name = 'Vietovės pasirinkimas'; ...
1
vote
1answer
1k views

insert post & Upload post thumbnail from the front end using ajax

i have searched & searched for an explenation and have found some answers that seem to be working for other people on this topics but i havent been able to get working. This is my "form" <div ...
0
votes
1answer
367 views

Best way to use ajax front-end?

The question is about which way is the best / easiest way to make a theme with ajax, using admin-ajax.php or normally. I ask because I see that complicates using admin-ajax.php for everything and use ...
0
votes
1answer
68 views

ajax page template

I am creating a wp theme that gets all its data via ajax (using ajax-admin.php). Now, I've set a div that would have the html of the page there (in the index.php file). My index.php is a simple one, ...
0
votes
2answers
197 views

AJAX requests within templates

I'm trying to come to an accurate decision here about safe ajax requests from a template. The thing about AJAX that always scares me is that the called script location is public: ...
2
votes
1answer
583 views

Edit post meta with checkboxes on front end

I'm trying to build an interface so that two custom fields for a custom post type can be edited on the front end with checkboxes. I'd like to display empty checkboxes if neither of those the fields ...
0
votes
1answer
682 views

Front-end update_post_meta with ajax

as written in title I'm trying to update a post_meta using Ajax. Actually I'm a complete newbie to Ajax and how it works so, if it is possible, I would appreciate if someone could 'take me by hand' ...
1
vote
2answers
577 views

is_admin() returns true when using admin-ajax.php from front end script

Had a situation today where I was using admin-ajax.php from a front end script. As I understand it this the wp way to make ajax calls (registering my function with the wp_ajax_nopriv_myfunction hook) ...
2
votes
4answers
358 views

Conditional check for front-end which includes ajax

I need a conditional which exits if the context is not a front-end view including AJAX requests. I have this at the moment: if (is_admin() && !DOING_AJAX) return; The DOING_AJAX bit ...
2
votes
2answers
372 views

How to correctly load wordpress in a non WP script for AJAX request

I want a script in my theme, ajax.php, which I want to load or access from other frontend pages using ajax. In ajax.php I want access to core WP functions such as get_posts(), do_shortcode() etc. ...
1
vote
2answers
175 views

Retrieve post info within AJAX helper function

I have a button within a post which a user can click. Once clicked, an AJAX call is made. My question is, within my PHP AJAX helper function (located in my theme's function.php) how can I retrieve, ...
4
votes
1answer
7k views

Upload post thumbnail from the front end

We would like users to be able to upload the post thumbnail when editing posts. How would this be done. I would imagine it would make use of the ajax functions of wordpress. Any ideas, Marvellous