0
votes
1answer
11 views

jQuery AJAX add json2 dependency?

I am working on a voting system in Wordpress with jQuery and AJAX. To make this voting system work I need jQuery in my theme. So wrote the code down in my functions.php. But for some reason my script ...
0
votes
0answers
25 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
vote
2answers
264 views

AJAX returns response 0

I'm trying to get user profile values using an AJAX call, but the response is always 0. Here's my PHP: wp_enqueue_script( // Add JS to <head> 'cc-author-change-post-author', ...
1
vote
1answer
181 views

Retrieving JSON data in ajax request from media uploader

I'm having some problems getting my JSON data that's being passed via an ajax request. I'm trying to implement the media uploader into a plugins settings page. I've got it functioning properly using ...
0
votes
2answers
198 views

Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)

I've searched a lot for this and I seem to get different answers. In my situation, my jQuery function has to use a PHP variable from a different file. How can I accomplish this? Clear and simple ...
0
votes
1answer
227 views

Create WordPress posts from JSON array using plugin in admin

I'm writing a WordPress plugin that I'd like to do the following: Add a WordPress plugin admin page that contains a button When you click the button, it loads an array of JSON objects from a file, ...
0
votes
1answer
348 views

Adding inside wp-plugin jQuery script that receives JSON-formatted data, generated by php-function inside this plugin

I'm trying to add Highstock chart in my plugin. It requires input data in json format. But I have some troubles with default json parser in jQuery. I've already read this article, but still can't ...
0
votes
1answer
110 views

Adding a time stamp on post view

Hi there we are using this ajax function to update the views of our custom "posts" if( !empty( $_REQUEST['action']) && $_REQUEST['action'] == 'update_view_count' && ...
0
votes
2answers
159 views

Syntax for a function in order to get post's title in JSON encoded response [closed]

I use the following code in functions.php in order to obtain all the images attached to a post so I can retrieve them via AJAX. <?php function get_all_images($post_id=0, $size='bigger', ...
1
vote
1answer
776 views

Intergrating agile carousel to wordpress: how to write the ajax_callback function

json is totally new to me how to write an ajax_callback function for agile carousel to work in wordpress? Below is the jason data format that I need to write as php arrays for it could be parsed by ...
-2
votes
1answer
326 views

How can I json_encode the output of my function?

How can I json_encode the output of this function I use to get all attached images of a post? <?php function get_all_images($postid=0, $size='bigger', $attributes='') { if ($postid<1) ...
11
votes
2answers
1k views

How to cache json with wp-super cache

In a new project we are using wp-super-cache (the client's preferred plugin) to create the static html files for custom content types. But we are trying to figure out if everything is being cached ...
4
votes
3answers
260 views

WordPress function that makes HTML safe to be sent via AJAX request

What is correct way to send HTML back to an AJAX request in WordPress? I currently have this: add_action( 'wp_ajax_nopriv_get-location-info', 'sc_locations_get_location_info' ); add_action( ...