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 auto-...

learn more… | top users | synonyms

0
votes
1answer
27 views

create a custom field that let me include other posts

I need to create a custom post type with a single custom field that is, basically, a list of other posts id. In order to find that ids I would like to add a kind of "ajax search" ability to that ...
0
votes
0answers
31 views

WP_Query for liked posts is showing all posts if none are liked

I'm using the plugin Favorites for WordPress to allow visitor's to like products presented with a Masonry grid on the site. On the site I have a page which lets the visitor see all his or hers liked ...
0
votes
2answers
310 views

Ajax call returns 0 when add_action is inside a class in functions.php

Ajax call returns 0 as output. I am sure that hook is not working and it's not calling the test2 method. Why is add_action(... not working inside class in functions.php? --------Wrap inside functions....
0
votes
0answers
555 views

How to configure Dropzone.js to work with Wordpress media attachments

I have built a site that has a public front end which shows off profile pages for cars. I have built a members only back end which allows people to create accounts, and then make a profile page for ...
1
vote
1answer
142 views

How to use oEmbeds on Post Content during AJAX requests

I have an AJAX request that returns a post. The post_content has links to Twitter, YouTube, TED and other platforms that are registered as oEmbed providers in a default, vanilla WordPress install. By ...
0
votes
0answers
170 views

[jQuery]Adding shortcode

I have been struggling with this the entire night, with no hope of ever reaching my goals. I have browsed through several books worth of support pages, but I can't get this to work. I am trying to ...
0
votes
0answers
19 views

Retrieve localised value

I have send ajax request wp_localize_script('fw-alt-block', 'ajax_custom', array( 'ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('cr_ajax'), 'loading' =&...
1
vote
1answer
75 views

Loading custom content type from ajax results?

Using WordPress 4.3 and we have a custom post type with custom fields. It's easy to just import all of this content from a DB to the WP DB and everything will be there. Problem is, all internal work ...
0
votes
0answers
57 views

How do respond with a chunked response via WP Ajax?

I think I'm missing something because it never spits out the lines progressively but instead, waits for the whole thing to finish and then respond with all of the lines. add_action( '...
0
votes
0answers
16 views

In Theme Customizer, need to reference outside control values from within checkbox's value bind

This post pertains entirely to the Wordpress Customizer (Wordpress 4.3). I have the following controls: Text input "Disclaimer" Text input "Global Disclaimer" Checkbox "Enable Global Disclaimer" ...
0
votes
0answers
33 views

Skip over get_header()?

I'm trying to retrieve the content of a page with AJAX and am hoping that there's a way to essentially skip over the header. What I would like to do is get the rendered content of the page returned to ...
0
votes
1answer
319 views

adding ajax load more to display images from meta box

I am using metabox's advance file uploader to upload images. <?php $images = rwmb_meta( 'tj_file_advanced', 'type=image&size=YOURSIZE'); foreach ( $images as $image ) { ?> &...
0
votes
1answer
231 views

How do I update_post_meta() or add_post_meta() with an AJAX call

I have a CPT called albums. The CPT have some custom fields, I want those fields to be blank in the post editor, so the person who is editing a post can ad a track to the album from the editor and ...
1
vote
1answer
86 views

Posting to admin-ajax from front end. Is this redirect ok?

I'm posting a form to admin-ajax and the redirect use to be within the success handler. That was taking too long to receive from the server then redirect, even though it was only a small json response ...
2
votes
0answers
81 views

Cannot update my options using wp_ajax

I have implemented wp_ajax in on my options page but the value of my options are not getting saved or updated. Here is my form: public function email_settings_form(){ // Set class property $...
0
votes
1answer
270 views

Passing form data via AJAX to REST API And displaying results

I'm new to WordPress but have been programming PHP for a long time... I searched a bunch of questions but couldn't find what I need. I have a page with a search form that contains a few parameters ...
0
votes
1answer
87 views

Loading post template that contains a nested loop with ajax

I'm currently working on a project where I'm loading a post with ajax. I'm using get_post() to get the post, setup_postdata() to setup the post data, and get_template_part() to load the template ...
0
votes
1answer
571 views

Can't load search results with ajax

I'm trying to load search results on my page without reloading. I tried multiple approaches already, but I still can't make it work, despite using someone else's confirmed solution. Please find the ...
0
votes
0answers
330 views

Category filter with load more ajax

What I am trying to do is to do an Ajax request to filter posts on category click depending on the category id, then apply load more posts by ajax. Problem: when I fire the ajax call by clicking on ...
0
votes
1answer
157 views

Allow user to Upload image and manipulate it on the frontend

The site I am working on allows users to post things up for sale. In the form for creating their post, there is a simple file upload field. The problem is that sometimes when users upload images they ...
0
votes
0answers
40 views

Is there a hack for using is_page() within the function.php file?

I've created a function in my functions.php that's called when the submit_form event is fired on the front-end. Here is the code: add_action( "wp_ajax_nopriv_submit_form", "submit_my_form" ); ...
0
votes
0answers
954 views

Woocommerce ajax checkout submit

So, in woocommerce, when a product is purchased, the user is redirected to "review-order" page. I am tying to make it so that the "review-order" page is instead shown by ajax on the product page ...
0
votes
0answers
63 views

ajax returns -1 in multisite sub domain

i am using the same theme for 2 language site - i didnt use a plugin but rather created a multisite (i like it better) - but... i have a problem with ajax which seems to work for main site but not ...
0
votes
0answers
65 views

Weird admin-ajax.php problem

In my site, each request on the home page is also making a POST to wp-admin/admin-ajax.php. 10.30.4.122 - - [21/Aug/2015:06:07:53 -0400] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 275 "http://...
1
vote
0answers
126 views

template_redirect or admin-ajax.php?

My plugin needs to be reachable by the public and accept query vars. When called, it will run some backend db tasks, call a 3rd party API and sometimes redirect. Previously, I was using ...
0
votes
1answer
56 views

First time doing Ajax with WP, how to do it?

I have been trying to work this out from various posts over the years but just can't seem to get it to work as I am not a Jquery guru and I am struggling to get my head around it. My html: <...
0
votes
0answers
62 views

Loading ajax does not run through filter the_content

I have created a quiz page with a list of question. I use ajax to load the question content into the quiz. However, only the first question which loaded directly (not through ajax) render correctly. ...
0
votes
1answer
176 views

Can't pass the variable from a select to PHP query

I'm trying to make a dependent drop down with AJAX. I managed to get the chosen variable but I can't pass it to the PHP. Here's my code: action.js window.onload = function($) { jQuery("#brand")....
0
votes
0answers
36 views

To get the data from the Database is not working?

The below code is reponsible to display a dropdown options that while selected a options a google map was appeared. But when I put the shortcode into my page the options are being shown. But the ...
0
votes
0answers
116 views

[jQuery]Autocomplete and $.post

I managed to solve it using Sisir's push in the right direction. Here's the javascript function: function render_edu_hook_javascript() { ?> <script type="text/javascript"> var ...
0
votes
2answers
251 views

wordpress ajax contact form - error 500

I've tried to create a simple ajax contact form plugin. all things seems good till user push the "send" btn. it sends error 500. this is my script.js codes: jQuery(document).ready(function(){ //Get ...
0
votes
0answers
350 views

Wordpress ajax load more returns duplicated posts

I'm trying to load more posts from my custom post type via ajax call, it sounds like i'm doing everything alright but one thing which is causing the duplication issue. My load more button does work ...
0
votes
0answers
2k views

WordPress AJAX File Upload - FrontEnd

So I have been reading through every WordPress front-end AJAX file upload tutorial I can fine. Nothing is working for me at the moment. The one that makes the most sense to me is this one: http://...
0
votes
0answers
136 views

After wordpress widget save (ajax call) tinymce editor gone, data not saved

I have made tinymce editor for textarea fields in widgets. I'm enquing scripts: wp_enqueue_script('tinymce', home_url() . '/wp-includes/js/tinymce/tinymce.min.js'); wp_enqueue_script('tiny', '/wp-...
0
votes
1answer
136 views

I have to post data by AJAX in wordpress to another Website

I have to post data by AJAX in wordpress to another Website (http://123abc.com/register) .But I always get Error .This is my jquery AJAX code: <script> $(document).ready(function() { // ...
0
votes
0answers
159 views

Infinite scroll in ajax

So, I have ajax enabled on my wordpress site as following: id within any anchor within the chosen div will be saved and used to find an appropriate php file then loaded at an appropriate content div. ...
0
votes
0answers
92 views

Declare inline background image in functions.php

I'm not sure if this can be done as I cannot find anything to help me anywhere no matter how hard i try. I'm using Ajax to load to in posts on the press of the button. the posts that are loaded in are ...
0
votes
0answers
117 views

Modify category archive page loop on functions.php

I was able to modify the query on the category archive page using global $wp_query; $args = array_merge( $wp_query->query_vars, array( 'tax_query' => array( array( '...
0
votes
0answers
49 views

Create multiple Instances of Ajax function and Control Variables from Template file

I received some help previously in order to build a Wordpress Ajax Load more function, However the site I am building is using different variances of this on different pages pages. The issue I'm ...
3
votes
0answers
327 views

Initialize TinyMCE editor / visual editor after AJAX insert

I have a "repeater" style field group on a custom options page. There's an active visual editor in a hidden state, and when the user clicks "add new" the whole row is cloned. I then need to initialize ...
0
votes
1answer
74 views

wp_ajax is not calling the action

I am developing a plugin in which Ajax is not working. I'm using this code: add_action( 'wp_ajax_cpm_add_update', array( $this, 'edit_added_people' ) ); The edit_added_people() function is not ...
2
votes
3answers
163 views

Cannot access current post's ID in custom plugin

I have a plugin that prepends an upvote box to the_content of a single post, sends data via AJAX back to the main plugin PHP file and calls a function to update a database value on success. Here is ...
0
votes
0answers
212 views

Dislay Admin Notifications through Ajax

I am writing a plugin that will require its own settings page in the WordPress admin menu settings section. I have done most of it correctly, and I am stuck at one point. I understand that in order ...
0
votes
0answers
65 views

How to get query results for the next page

How to get query for posts from next and previous pages on Blog via ajax call? I'm thinking about making copy of the current query with offset like this: $curr_query = new WP_Query( array( '...
0
votes
1answer
982 views

Are innerHTML elements visible to jQuery functions?

For example, on my admin page i.e. dashboard side: //This is hidden until search results come back //which will be inserted as innerHTML within #searchResults <div id="hideShow"> <h2>...
0
votes
0answers
75 views

Paginate Comments Via Ajax When Not On Parent Page

I have a page that I am using a custom query to pull in the comments from another post. The comments are successfully being rendered and formatted and the pagination links are showing up correctly as ...
1
vote
2answers
178 views

Click loads template via ajax

I'm trying to load a template via ajax if the user clicks on a button. This is the code I'm using: On functions.php: function phantom_scripts() { global $child_dir; /* Ajax Requests */ ...
0
votes
1answer
63 views

How to stop being directed to admin.php after sending request to admin-ajax.php

On my plugin admin page, I have make an ajax request to admin-ajax.php. For some reason, once the request is made, another request is made to admin.php which directs me away from my current page... ...
0
votes
0answers
54 views

Class is not supporting Ajax

I'm trying to make a plugin table which extends the existing WP_List_Table but I can't call my Ajax function with a hook: add_action( "wp_ajax_test_response", array( $this, "my_function" ) ); Here ...
1
vote
1answer
41 views

Is there a restriction in WP on the use of jQuery load function?

I'm just trying to load a simple txt file for testing purposes. jQuery(document).ready(function(){ jQuery("#buttonAjax").click(function(){ jQuery("#demo").load("demo.txt"); alert(...