The tag has no wiki summary.

learn more… | top users | synonyms

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
1answer
509 views

Why does WordPress use serialize rather than json_encode for the options table?

I have a basic understanding of serialize (I come across it often when I'm migrating WordPress installs) and I just discovered json_encode. Given that serialize causes so much trouble with replacing ...
4
votes
3answers
259 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( ...
3
votes
1answer
371 views

Trying to get custom post meta through Jetpack JSON API

I'm using the Jetpack for Wordpress to produce a JSON API for my Events custom post type, which works fine: https://public-api.wordpress.com/rest/v1/sites/MYSITE/posts/?type=events&number=100 ...
2
votes
4answers
3k views

Wordpress REST endpoint with JSON for Mobile App integration

Is there some REST API that Wordpress supports, out of the box or through any plugin that exposes the same information exposed through the normal pages? (I.e. latest posts, filtering by categories ...
2
votes
1answer
1k views

WordPress JSON output

Update: I've changed the code as following $cats = get_categories(); $output = array('categories' => array()); function collect_posts(){ $args = array( 'numberposts=' => 9999, 'category' ...
2
votes
1answer
1k views

API JSON Data in WordPress

On the Google developer API page, it talks briefly on retrieving a dynamic list of fonts using JSON/JavaScript. I was wondering how would I be able to pull the web fonts API into my Wordpress theme ...
2
votes
1answer
264 views

JSON: schedule creation of json file

After some research I've managed to create a json file which I use as input for Twitter's typeahead (prefetch). On my website I have several hundreds of events and several thousands of artists (both ...
2
votes
1answer
366 views

fetch_feed: retrieve entries in the appearing order, not chronologically

I'm using WP function fetch_feed to retrieve a feed and display its items. <?php /* include the required file */ include_once(ABSPATH . WPINC . '/feed.php'); /* specify the source ...
1
vote
2answers
819 views

Can't connect to my Wordpress website using Windows 8 app?

Im trying to connect to my Wordpress site (self hosted) through the Windows 8 app. First, after giving the Wordpress.com account details, it show my site and ask me to Authorize. after authorizing, it ...
1
vote
2answers
78 views

Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?

I am using the following code to generate a JSON feed. I need to extract the excerpt from posts, but when I run get_the_excerpt() it takes 28 seconds (yes SECONDS!) to run on my local server versus ...
1
vote
4answers
1k views

WordPress is stripping escape backslashes from JSON strings in post_meta

I thought I was making my life easy and being future-conscious by saving some content as bits of JSON in custom post_meta fields. Unfortunately, WordPress doesn't agree and is making my life ...
1
vote
2answers
433 views

Creating post content from external web scraper via JSON or RPC

I'm looking for a way to post content from a web scraper external to our Wordpress site to post content its scraped into our site. Right now, I have the scraped content formatted into JSON. Could I ...
1
vote
1answer
60 views

Placing assets for external use

I'm developing a plugin, that is meant to work on external requests to a wordpress site. The plugin will generate a .json file, and will come with 2 default .css style and 1 .css file that will ...
1
vote
1answer
130 views

Vagrantpress + composer

I was looking at the roots.io blog, where I learned about Vagrant and Composer which in combination seem to give you a more intelligent development environment and dependency management system. I ...
1
vote
2answers
394 views

How to get all events from 'All in one Events calender' plugin in JSON format?

I am using All in one Events Calendar plugin to add the events. It works fine in CMS. I would like to display the events data in mobile version. for this i used JSON-API for obtaining web-services in ...
1
vote
1answer
622 views

How to encode post content as JSON?

I`m trying to construct a json object but are having difficulties with the_content since it returns newlines, which causes the script to fail. The error messages received is: Uncaught SyntaxError: ...
1
vote
1answer
415 views

How to handle shortcodes when using the JSON API

I'm wrangling a little logic problem: I'm making a single page WP theme which uses the JSON API for the content and Mustache style templates for the presentation... However, shortcodes? What would be ...
1
vote
3answers
643 views

using wp_remote_get instead of file_get_contents [duplicate]

have run my theme through the Theme checker plugin and it seems upset about use of 'file_get_contents' to get a json url. I've found posts saying i should use wp_remote_get. I'm currently decoding the ...
1
vote
1answer
170 views

Pass data from wordpress to javascript in JSON

Currently using this simplified code to pass data from WP to JS. function add_map_data() { $objName = "MapData"; $array = array( "MapViewLatitude" => "51.505", ...
1
vote
1answer
371 views

Create post using JSON api plugin

I am working on a project where the user writes their content on one wordpress blog (as a draft) but wants it published on their own wordpress blogging site. This seems strange but it is the core ...
1
vote
2answers
260 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
0answers
102 views

Help with JSON decode and foreach [closed]

I have this XML: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=science[journal]+AND+breast+cancer+AND+2008[pdat]. And I would like to get some information with JSON and ...
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 ...
1
vote
0answers
294 views

Why is json_decode failing?

I'm trying to determine if this is related to my having the latest version of PHP on my server while using the latest version of Wordpress. Or if I'm just doing it wrong: Here's my function that is ...
1
vote
1answer
775 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 ...
1
vote
0answers
370 views

How to parse date format using JSON API plugin 1.0.7? [closed]

I'm using the JSON API plugin to display my blog posts on my mobile website. I've got everything working as I'd like, however the the date displays in this format: 2012-03-21 20:03:30 However, ...
1
vote
2answers
462 views

wordpress JSONAPI introspector always limits number at 10?

I'm a little new to Wordpress and the JSON API so forgive me if this is a newbie question but i'm trying to get all of the posts of a few different custom post types and return them as JSON via my own ...
0
votes
2answers
440 views

json_decode does not work on Wordpress

I'm trying to convert a json string back into an array in wordpress. Here is the json string that I'm getting back from the database: [ { "item_title": "Kindle Fire HD 7\", Dolby Audio, ...
0
votes
1answer
172 views

wordpress is adding a second backslash when I use addslashes

I don't know why but it seems like wordpress is adding a second backslash when I'm using the following functions: addslashes($str_with_single_quotes) ...
0
votes
1answer
705 views

Custom JSON feed rewrite

I'm trying to implement a feed of information from an Event custom post type in JSON format, to be used in a FullCalendar implementation, pretty much as described here. The one thing I wanted to ...
0
votes
1answer
36 views

Retrieving a JSON feed of my posts and displaying thumbnails

I want to show a feed of my latest posts though json. I seem to be able to do it - up to a point. I am retrieving my feed like so: var json = <?php echo json_encode($query->get_posts()); ...
0
votes
1answer
63 views

access JSON results from wordpress database with wpdb

I have JSON results from Google API added to to wp_options table. At this point I just need to echo the specific elements. Namely, the coordinates. The option_name I have is py_menu_item. One of the ...
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
316 views

JSON API not showing full content

I am trying to create a Windows Store App using IdeaPress (https://github.com/ideanotion/ideapress/issues), which relies on the JSON API Plugin ...
0
votes
1answer
162 views

Twitter feed - Failed to open stream [closed]

This works, however I keep getting a failed to open stream every so many random refreshes/page views. I've also tried this code on two different hosts with the same results. I've also tried using ...
0
votes
1answer
93 views

uneven behaviour create a post in using json api with white spaces

$url = "http://192.168.201.214/wordpress/?json=posts/create_post&dev=1&nonce=".$_POST["nonace"]. ...
0
votes
1answer
121 views

XML to Json code issue

I've written a script to display all WordPress posts organized by category in XML format. Code was // get all the categories from the database $cats = get_categories(); header('Content-type: ...
0
votes
1answer
171 views

Fetching ten ten records from JSON API in word press

I am using JSON API for getting web services.. I have 80 records in my wp_posts table . I need to display 10 , 10 records so that my mobile app will be faster. I used the following method in this ...
0
votes
0answers
14 views

Developing a plugin, ran it through P3 Profiler, shows up slow, but I don't know why

I am having an issue with my plugin I'm developing. After using the GoDaddy P3 Plugin profiler, it shows that is taking up a large amount of runtime, but the plugin itself is very minimal. It just ...
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
1answer
80 views

Implementing backbone.js to retrieve category posts using JSON API

Note: I reformulated this post after solving my original problem because I immediately ran into another problem that can fit under the same title. First I'll summarize the first problem and my ...
0
votes
0answers
22 views

Is there a way to share a template/markup with the JSON API so that it doesn't need to be declared both in PHP and in JS?

Current Setup I'm using WP's JSON API on a custom post type archive to query some posts. I then parse the returned JSON object to output my markup accordingly. I also have a single post type template ...
0
votes
0answers
25 views

WP Import changes JSON string

I have this JSON string in my exported XML file ...
0
votes
0answers
22 views

JSON get data from registration

I just want send data from wordpress registration of each new user to Emailomat (API here: http://hikaru.cz/doc.htm ). But I don't know JSON and this documentation is not helpfull for me. Can anybody ...
0
votes
0answers
58 views

JSON API similar plugin can't set custom fields

I'm trying to use a similar plugin to JSON API, called ScrollBlog. I'm using two custom fields, an external link and an author's name. JSON API parses them ok, but when I try to use ScrollBlog (coding ...
0
votes
0answers
24 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 = { ...
0
votes
0answers
28 views

How to schedule future and past posts with metaWeblog.newPost

I am attempting to remotely post articles to a wordpress page and no matter what I attempt to do I cannot publish in the future and the past. I have commented out some past attempts (some found on ...
0
votes
0answers
22 views

wp_nav_menu transferred to other domain using JSONP - menu not echoed in correct place

I have a WP website, and a related shop that's on a different domain / site. I want to have one navbar that I can update in wordpress that will also update the shop without me having to do it twice. ...
0
votes
2answers
100 views

REST API page not found

I'm trying to get the json form of data of my web. My web url is http://ecseventsfeed.x10.mx/wordpress/ I tried to follow this post, ...