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 ...
5
votes
1answer
635 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
297 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( ...
4
votes
2answers
790 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 ...
3
votes
2answers
221 views

How do you get posts by meta_query using the JSON API plugin?

I would like to get post with an API method using a kind of meta query. I have 2 custom fields "place" and "dayoweek" and I want to retrieve via API call all the post that have some values for this 2 ...
2
votes
4answers
4k 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
2k 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
445 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
483 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 ...
2
votes
0answers
219 views

How to get featured post title & image using JSON API?

Is there any possibility to get featured post title and image using the JSON API. I tried using this: example.com/?json=the_post_thumbnails&count=3 But instead of recent posts, I get featured ...
1
vote
2answers
960 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
84 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
512 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
68 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
487 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
1answer
179 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
451 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
748 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
95 views

Why use wp_send_json() over echo json_encode()?

When sending a JSON response back to an AJAX request, why use the WordPress function wp_send_json() and not echo json_encode()? What is the benefit of using the WordPress function wp_send_json() over ...
1
vote
3answers
1k 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
184 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
2answers
40 views

Hook Into the_content Filter For JSON API Only

I'm trying to figure out a way to remove the shortcodes from my JSON output which I'm using the Wordpress JSON API for. I need to remove the shortcodes from the content before do_shortcode is applied ...
1
vote
1answer
1k 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
635 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
165 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
220 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
489 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
858 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
410 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
552 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
679 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
801 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
238 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
109 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
93 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
279 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
2k views

Import JSON feed to Wordpress

We have received a URL which is a JSON file apparently: http://www.domain.com/tools/export-json/?destination=hawaii I am completely clueless when it comes to JSON and Wordpress. Anybody know where ...
0
votes
1answer
401 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
168 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
99 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
129 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
178 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
9 views

JSON API User to create new user phonegap wordpress

I have a problem on creating new user by using JSON API USER. It works on directly putting url in browser address but not working on jquery ajax in phonegap. When I put this address into browser, the ...
0
votes
1answer
39 views

Get JSON from self hosted wordpress site

I am very new to wordpress so this may seem basic. I have a NON-WordPress website in which I would like to consume various blogs (via category/tags etc etc) from my WordPress site. Currently I am ...
0
votes
1answer
36 views

Setting pages for posts

This is my json rest api function. When called, it returns 24 posts, but there are much more in total. How can I page the response so I can change pages with something like ?page=2 to be added to curl ...
0
votes
0answers
26 views

JSON Feed on my wordpress Blog

I have just installed 2 plugins for JSON feed for my blog as I need to develop an Android Application for the same. Plugins used : 1.) http://wordpress.org/plugins/feed-json/ 2.) ...
0
votes
1answer
46 views

Preserve shortcode content formatting

How can I preserve the formatting of the content within a shortcode block when I switch back and forth between the visual and text editor in TinyMCE? As in, the stuff between [myshortcode] and ...
0
votes
0answers
52 views

how build custom json api controller for all registered users

i use the json api! from wordpress. And try to build an own json api controller, i want return all registered users with the following controller but thats not give an array with all users, ...