The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
76 views

Show popular post in another php website via WP REST JSON API

I need to show popular & recent posts in another php web site under the same domain. example: domain.com -> main website (php, mysql) domain.com/blog -> wordpress blog Need to show popular, ...
0
votes
0answers
30 views

WP REST API. Configuring JSON routes

I am working through the documentation on wp-api.org/ and trying to get my head around this awesome plugin, but I have a question that I can't find the answer to anywhere, so thought I'd ask...it's ...
0
votes
1answer
17 views

Custom url in wordpress

I want to make custom url and handle it from my plugin Ex:- domain.com/myplugin=endpoint&id=num&.. i want to return just json data not template Thanks
0
votes
0answers
16 views

Implementing the wp json-rest api

I have a client that wants to use the wp json-rest api to allow third-party sites to push custom posts (in this case property listings) up to our site. I've been looking at using the wp json-rest ...
0
votes
1answer
21 views

Result from wp_send_json adds line feed

I've got a local Windows stack running AMPPS at 5.4.35 and my code runs fine but when I deploy to my Bluehost server running PHP 5.4.28 the execution of wp_send_json is different. wp_send_json( ...
0
votes
0answers
372 views

Uncaught TypeError: Cannot read property 'ajax' of undefined

I'm trying to show data from a JSON object in the content section of a WordPress website. The following static HTML works like a charm. <!DOCTYPE html> <html> <head> ...
0
votes
1answer
532 views

Implementing Isomorphic JavaScript (React JS) in Wordpress?

I'm about to start with a new project and would like to incorporate React as I want to learn more about it and this specific project would be perfect to get started as it's not that time sensitive and ...
0
votes
0answers
189 views

Fatal Error in \wp-admin\includes\misc.php after failed WP update

I was recently approached by a client whose wordpress site had been hacked. The hack caused traffic from search engines to be hijacked to cuteonbags.com. I narrowed down the malware in question and ...
3
votes
6answers
401 views

I want to create a custom slug in WordPress and output JSON. How do I do this?

I have an array: $cats = array('Hobbes', 'Simba', 'Grumpy Cat'); I would like to create a custom endpoint called "http://example.com/cats". Whenever you visit this URL, have it output the array as ...
0
votes
0answers
277 views

Wordpress wp-json API - Custom Post Type returns 403

I've been trying for a full day to get a really basic install of the WP-API to answer to a custom post type (in this case called 'transactions'). The post type is set up and fully public, and it's ...
3
votes
2answers
265 views

Allowing admin-ajax.php to receive “application/json” instead of “x-www-form-urlencoded”

I'm using AngularJS's $http function to send my payload to WordPress's admin-ajax.php subsystem, but it seems the latter only accepts x-www-form-urlencoded data, instead of the application/json ...
0
votes
1answer
35 views

Is it possible to pass variables to WordPress externally?

I would like to know if it is possible to pass json variables from a form which is located outside WordPress? This is the situation: The user fills a form located on x server. Then his answers are ...
1
vote
1answer
20 views

JSON - Permission Error?

I have two dropdowns to filter posts on a website. The second dropdown populates based on the selection of the first, ie: [CATEGORY] + [SUB-CATEGORY] = SEARCH The problem is that occasionally the ...
0
votes
1answer
112 views

AJAX Call in Plugin Returns More than JSON

I have a plugin tat extendeds Gravity Forms consisting of one PHP file and a JS file. The PHP file can be found here: http://pastebin.com/VUX5AfLP The JS File can be found here: ...
0
votes
3answers
88 views

Create a file format (csv,json,etc) when save/update a Post

I need create a file (any type: json, php, csv, txt) when I create or update a post from WPadmin. The format structure would be: ID, "operation to execute" (new post, update post, delete post), ...
0
votes
0answers
92 views

Ajax JSON response works for admin

I try to add custom post type object from front-end form with AJAX, right JSON response works only if i logged as admin, otherwise i get html code of main page, but object is added. js: var ...
0
votes
1answer
323 views

Querying A Post That Includes Two Taxonomies Using JSON Rest API

I'm using the JSON Rest API plugin (https://wordpress.org/plugins/json-rest-api/). I have two custom taxonomies with one term each: Inner Part Categories Eye Symptoms Categories (Man) Broken Bone ...
0
votes
0answers
43 views

Cannot save json in wp_insert_post

This is my code. $offer_name doesn't get saved. $obj = json_decode($result, true); $i = 0; foreach($obj['response'] as $item) { for($i=0;$i<=$item['count'];$i++) { $offer_name= ...
1
vote
1answer
152 views

Displaying Content with WP Rest API

I have been spending some time working with the new Rest API. I understand what it is doing but I don't understand how the JSON is used to actually display the content on a page. I have been fooling ...
0
votes
0answers
80 views

Usage of wp_send_json_success and wp_redirect at the same time

I have to send the success response to ajax if user filled the form fields successfully or not on the client side and redirect to the other page which finalize his authorization at the same time on ...
0
votes
0answers
56 views

JSON API - custom field as an image

I am returning all my recent posts of a custom content type 'myfriends' in WP with $.getJSON("http://localhost.com/?json=get_posts&post_type=myfriends", function(data) { problem is rather than ...
2
votes
1answer
657 views

WP JSON REST API (Ryan McCue) how to query posts with specific meta data with 'AND' relation?

I use Wp_query class to query my posts. 15 posts are in a template fetched on page load and their filtering works fine. Infinity scroll fetches for other posts using JSON restful services. The filter ...
1
vote
1answer
112 views

Upload a json file in php

I'm trying to upload a json file through PHP. This is the code that i have yet. if( isset( $_POST['upload'] )) { $target = "/"; $target = $target . basename( $_FILES['upload']['name']) ; ...
1
vote
3answers
7k views

Can't get a JSON object in response to an ajax request with wp_ajax

I have a problem with WordPress and ajax. This is my javascript part (I trimmed it a bit): var posts = $.ajax({ type: 'POST', url: ajaxurl, async: false, dataType: 'json', data: ...
1
vote
1answer
153 views

esc_attr() corrupts json values

Is this a esc_attr() and esc_js() bug or I am doing something wrong? function _action_escape_test() { $json = json_encode(array('test' => '<>\'"[]&quot;')); foreach ( ...
4
votes
1answer
982 views

Building a custom REST API

I have a WordPress.org site which takes user input, searches a custom database and displays the results of the query. I have this working using the wpdb class. Now I'm trying to get this working for ...
0
votes
0answers
21 views

Validate email, if field has characters

I am building a small form on my website where I want users to be able to send me a message and have the option to include their email in an email input. It's fairly simple: ...
1
vote
0answers
183 views

Submit comment via JSON from Android device

I have a Wordpress blog together with a little Android App, developed by myself. Now I want to expand my app a little. My goal is to implement a kind of live ticker. The function is as follows: On my ...
0
votes
0answers
50 views

Output JSON and no theme

I would like my plugin to create a url which only outputs JSON. The JSON feed contains settings and other info about this plugin. I would like to know how my plugin registers a url which only ...
0
votes
1answer
140 views

Using WP_Query to grab custom meta values, foreach to json object

So I have 4 custom meta boxes for each post on a wordpress site relating to the product this client sells. I have 3 dropdown boxes, one for category, and two for two of the custom meta boxes. The ...
1
vote
1answer
145 views

Wordpress JSON API remove posts from a specific category

I have installed Wordpress JSON APi plugin, the idea what I want to do is to retrieve all posts from a websites except a specific category for example with ID: 434. I need all posts except from this ...
0
votes
0answers
191 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
152 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
40 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 ...
1
vote
2answers
189 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 ...
0
votes
0answers
97 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
133 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
152 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, ...
2
votes
1answer
825 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 ...
4
votes
2answers
2k 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
0answers
872 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 ...
0
votes
0answers
64 views

External json physician database to display results in WordPress

We're working on a physician network site in WordPress using the Divi template and we have most work completed. However, we've also been tasked to have a physician search that will bring up results ...
0
votes
0answers
433 views

Fetching instagram api not working on wordpress

<?php $json = file_get_contents('https://api.instagram.com/v1/users/userid/media/recent/?access_token=accesstoken'); $a_json = json_decode($json, true); foreach( $a_json['data'] as $key => ...
0
votes
1answer
114 views

Search in particular category in wordpress

I am currently using the JSON API to get the data from wordpress http://wordpress.org/plugins/json-api/other_notes/ The plugin helps to retrieve the wordpress post data in JSON format I notice that ...
0
votes
0answers
255 views

wordpress plugin JSON API search within specific category

From the JSON API plugin doc I notice that I can get the post within some category http://abc.com/?json=get_category_posts&id=9 And I can also search the post ...
0
votes
0answers
31 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
92 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
402 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
59 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
1answer
320 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()); ...