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
votes
1answer
49 views

ajax response is 0 instead of 'script' [duplicate]

I keep getting a response of 0 instead of string, which is my function echoes. Why? code from functions.php // enque test.js function add_script() { wp_enqueue_script( 'test', ...
0
votes
0answers
132 views

TinyMCE in ajax modal window

I'm trying to use TinyMCE editor in fancybox ajax loaded (lightbox like modal window). I have managed to load it but i can't type in it and Text tab there are no quicktags buttons.. It respond on ...
0
votes
1answer
65 views

Localize script not working

I am testing ajax in wordpress, and it basically works but I do not want the url to be hardcoded, so I tried using wp_localize_script to get an object to use, but I get an error saying: ...
0
votes
1answer
190 views

redirect does not work in ajax function

I'm using ajax to post the form data. In the end I want to redirect to homepage. I'm trying following code, it does not work. It returns error 302. How can I redirect in the following function? ...
2
votes
1answer
56 views

Edit a different page in WP Customizer

I'm working with Customizer's incredible options, and so far so good, it's really powerful and does everything I want. However, I'd like to extend it, so instead of editing only the main page, I want ...
0
votes
0answers
51 views

retrieve data form wordpress into app problem with $.ajax access to an object

i'm working on my first app, based on my blog created with wordpress, anyway the problem is that i can't access to to different categories using json api. This my code: var requestData = { ...
-1
votes
1answer
1k views

Infinite Scroll applied to ajax loaded content

I'm doing a WP_Query on let's say page-a.php, that page has a div called target where page-b.php is being loaded into. Page-a is a custom template and page-b is an archive page. The structure on page ...
0
votes
0answers
376 views

Query multiple taxonomies plugin with ajax, archive loading posts outside filters

I have a custom post type called jobs and within I have several taxonomies: Job type (full-time, part-time, practice, etc), Country, Job Area (design, development, etc). I'm using the plugin from ...
0
votes
0answers
128 views

AJAX Pagination not working

I have integrated an AJAX Pagination in my site sidebar, where I'm showing custom post type. Here is my code: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $new_query = ...
1
vote
2answers
858 views

WooCommerce: Translation lost on AJAX call in Checkout page

I'm using WooCommerce for a site that I'm currently working on. And I'm creating it for a language other than English. I do the translations by means of the .po file. The issue that I'm encountering ...
0
votes
0answers
158 views

How to handle cookies from a WordPress plugin on a cached page?

I'm attempting to write a plugin that can work with cookies on a WordPress site that uses page caching (why?). I've been following this tutorial on Esanctuary.net. I'm trying to write to the ...
0
votes
0answers
134 views

Ajaxify comments and insert new submit

I tried to ajaxify my comments system on wordpress. But I have some difficulties to understand what is the right way to insert the comment submitted. In fact, I'm asking if there is a way or a ...
0
votes
0answers
49 views

Ajax Auto Complete Convert All Plural Text To Singular

I am trying to create a wordpress search plugin that if you enter a text or keyword term, it would automatically convert any plural text to singular text e.g. "dogs" will become "dog" I am already ...
0
votes
0answers
100 views

How to Insert Popup box shortcode in wordpress

I create a Tinymce Popup box for inserting shortcode on content area in wordpress. When I click shortcode button then popup box open successfully with input field. But when I click popup box insert ...
0
votes
0answers
40 views

Plugin constructor called multiple times

I have plugin with the following structure - class emailPlg { static $tableName; static $pluginDbVersion = 1.0; function __construct() { global $wpdb; ...
0
votes
0answers
66 views

Get fatal error when using wpdb in jQuery.post target URL

Why am I getting a Fatal error whenever I use wpdb in the target URL of my jQuery.post? Here is my code so far. My process.php is this: <?php $to = 'myemail@gmail.com'; $subject = ...
0
votes
0answers
51 views

Hyperlink to execute PHP

Below is code that will add a column called Printed to Gravity Forms and display a green or red dot representing if the form has been printed. If the form has not been printed, I am trying to a) ...
0
votes
2answers
229 views

Loading by Ajax a plugin that also uses Ajax

I'm having problems with some "contact form" plugins whose use Ajax. The problem is that I use Ajax to call the plugin. Then the plugin is loaded, but when I try to submit the form, I'm redirected to ...
0
votes
0answers
56 views

Perform database function in target URL using jQuery.post

I have a popup which gets the users input (name and email) and sends it to a process.php so I can send an email. I pretty much have that done. But I need to add a functionality wherein it will also ...
0
votes
1answer
25 views

Loading a sidebar on an Ajax call

I wanted to load a custom sidebar when doing an Ajax call, so I found the way with: add_filter( 'loop_start', 'my_sidebar_widget', 25 ); but it is showing the sidebar even in media admin panel, so ...
0
votes
0answers
250 views

Can't get query string in ajax call

I'm developing a plugin that exports to a PDF your current posts view in the admin panel. Suppose you're in a post type "product", then the url must be: edit.php?post_type=product. What I want is to ...
0
votes
1answer
17 views

How to get site homepage from plugin?

I am creating a plugin that has a preview, kind of like the theme customizer preview. It displays the users site in an Iframe. The issue is that I can't seem to be able to get the users homepage using ...
0
votes
0answers
2k views

AJAX with Selectbox Plugins (Select2, Chosen, Selectize)

I have been searching all over the internet for tutorials on implementing AJAX actions from jQuery selectbox plugins such as Select2 , Selectize and Chosen. (these plugins look better than the inbuilt ...
0
votes
0answers
82 views

How to load comment form with AJAX?

We have a Wordpress website with a large number of logged in users. Hence, we cache as much as possible, which includes post pages. We've setup our website so that that the page is mainly dynamic, so ...
2
votes
1answer
470 views

Refine/Filter WP_Query Posts with jQuery or Ajax

I know this has been asked many many times, but I literally searched for an answer for more than 5 hours without finding anything that drives me in the right direction. What I'm trying to achieve is ...
0
votes
0answers
126 views

Contact Form loaded with Ajax

I'm loading Contact Form plugin with an Ajax request. It is correctly loaded, but when trying to submit the form, I get a blank page with a 0 as unique response. I'm guessing it has something to do ...
1
vote
0answers
190 views

do_shortcode via ajax

I try to call contact-form-7 via ajax with do_shortcode. But it shows just "shortcode code". function example_ajax_request() { // The $_REQUEST contains all the data sent via ajax if ( ...
0
votes
1answer
176 views

Add item to media library from blob or dataUrl

I'm trying to build a webcam snapshot recorder. It should take a picture and upload it to the WP media library via ajax / async-upload. Already managed to add a view to the media library. Recording ...
0
votes
0answers
71 views

admin-ajax.php nulls all php variables

I have a problem in a custom function. The function which adds to the WHERE clause in Store Locator Pro works correctly on its own, but I only want it to only work on a certain page, not on all my ...
1
vote
0answers
99 views

image.php content pulled with AJAX [closed]

I made a custom gallery set on my single-page theme where it lists the titles of the gallery post type, and when clicked, the thumbnails are ajaxed below. Then, I made another ajax to watch the ...
0
votes
2answers
219 views

Elegantly using JavaScript on widget admin forms

I'm working on a project involving a lot of widgets, and I'm thinking it'd be really great to have a "More options" section built using jQuery UI Accordion that expands when clicked. So, I've ...
0
votes
0answers
152 views

Pass jquery var to a function in functions.php

I have this js in /js/functions.js: jQuery(document).ready( function($){ //Some event will trigger the ajax call, you can push whatever data to the server, simply passing it to the "data" ...
0
votes
1answer
105 views

Execute Jquery when a specific page in my plugin is loading

I am building a plugin and I would like to be able to hide the wordpress admin side menu and top bar when a specific page is shown(or menu item clicked)? Should I call the jquery directly as a ...
1
vote
1answer
113 views

Function call via ajax – can't figure it out?

In my header.php file I've got … <script type="text/javascript"> var ajaxurl = "<?php echo admin_url( 'admin-ajax.php', 'relative' );?>"; </script> In my functions.php file ...
0
votes
1answer
224 views

how to call ajax on frontend of wordpress

In my plugin folder I have two file 1. hello-ajax.php 2. myajax.js and by shortcode I add this form on frontend <form id="theForm" method="post"> <input id="name" name="name" value = ...
1
vote
0answers
38 views

Wordpress P2 live problem

Everything worked perfectly in localhost. When I uploaded everything online, the ajax submission seems to not working. It's refreshing the page for comments and live updated is not working I have ...
0
votes
1answer
108 views

How to render the single post template with the post name?

I'm calling pages with Ajax and I have this code in functions.php to determine which page is called and then, render the corresponding template: function ajax_callback() { if( isset( ...
0
votes
2answers
104 views

Dynamic Gallery

I'm building a single page website and that means that all the links need to call for post content dynamically. I found this tutorial and with the help from some folks from StackOverflow I managed to ...
0
votes
1answer
4k views

Load page content with AJAX using Fancybox?

I can find a lot of tutorials about how to load pages dynamically in WordPress and even page contents, like this: how-to-load-just-the-content-of-a-wordpress-post-using-ajax and Best way to load ...
1
vote
1answer
100 views

Wordpress Plugin Page is Loading in Admin Content Container Instead of Separate Page

I am creating a wordpress plugin that has it's own UI. It looks like a standard web application, so everything that is done within the plugin is handled in this UI instead of integrating it with the ...
0
votes
1answer
152 views

How to load a plugin when doing an Ajax call? [duplicate]

I have posted this question: How to use shortcodes on a widget sidebar when doing an ajax call?, with no answers. Now I want to ask a more specific question. The problem seems to be that the ...
0
votes
0answers
183 views

Loading individual category post via dynamic tabs

I've been searching for a navigation solution for my wordpress site's front page that loads individual categories and their corresponding post through dynamic tabs. These are tabs or buttons that load ...
0
votes
0answers
90 views

How to use shortcodes on a widget sidebar when doing an ajax call?

I'm trying to use a shortcode from Promotion Slider Plugin inside a widget when doing an ajax call. As said here, I could achieve it doing: add_action( 'init', function() { ...
-1
votes
1answer
36 views

AJAX: Wordpress filters inside $html do not work as intended

I am sending HTML content through some AJAX magic and while everything is working as I wish, the output gives something along those lines in the page: "http://permalink.comtitle" It's as if all the ...
0
votes
1answer
132 views

jQuery form plugin, submit in the wordpress way

Trying to use jQuery form plugin in wordpress site to upload files. HTML markup: <form id="myForm" action="process.php" method="POST" enctype="multipart/form-data"> <input type="file" ...
0
votes
0answers
227 views

How to use AJAX to check if user is still logged-in?

I am working with Wordpress 3.8 I have an app that I would like to use AJAX to check with Wordpress to determine if their idle time has expired. In my functions.php, I have the following hook that ...
1
vote
1answer
137 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
1answer
239 views

Next Ajax call doesn't work

I'm submitting a form via Ajax: <form id="ajax-form-next" method="post" action=""> <input type="hidden" name="nextPosts" id="nextPosts" value="<?php echo $postIDs; ?>"/> ...
0
votes
2answers
425 views

Stop loading more posts if none left AJAX

I'm using the following JavaScript to load more pages in #work_items (see live at http://mtthwbsh.com): jQuery(document).ready(function($){ $('.older a').live('click', function(e) { ...
-1
votes
1answer
58 views

A refreshless WordPress website

As I said in my previous post, I am totally new in the WordPress world. My knowledge of PHP, Css, HTML and JavaScript is a little old but I am sure I can do this by my own with some guidance. Please ...