Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
36 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
2answers
42 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: ...
0
votes
0answers
12 views

enode correctly the results from $wpdb->get_results to be passed to jquery autocomplete [closed]

i've been reading jQuery's Autocomplete here Now, i'm querying the db with $wpdb->get_results and getting an array as follows: Array ( [0] => stdClass Object ( [c_name] => Data ...
1
vote
1answer
67 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
343 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
10 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: ...
0
votes
0answers
55 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
23 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
77 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
75 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
108 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
101 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
39 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
110 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
54 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
81 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
98 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, ...
1
vote
1answer
301 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 ...
3
votes
2answers
589 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
502 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
57 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
289 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
0answers
79 views

How can I search the post title and tag using WP_query of wordpress?

I am currently implement a search function to search the post from wordpress I would like to search the post by Tag , by title and return it as JSON I found a plugin that generate the result as JSON ...
0
votes
0answers
286 views

Wordpress JSON API plugin return multiple categories' post

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
1answer
95 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
183 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
28 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
54 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
303 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
40 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
46 views

WP Import changes JSON string

I have this JSON string in my exported XML file ...
0
votes
0answers
52 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
130 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
59 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
106 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
1answer
173 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
0answers
108 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. ...
1
vote
1answer
2k 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 ...
3
votes
2answers
1k views

Trying to get custom post meta through Jetpack JSON API [closed]

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 ...
0
votes
0answers
473 views

How to authenticate wp User though JSON?

I am developing an android application that is using wordpress as the base for its user management, now I want the users to be authenticated against the wordpress database through JSON. I am trying to ...
1
vote
2answers
964 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', ...
0
votes
1answer
109 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 ...
1
vote
1answer
207 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
0answers
214 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 ...
0
votes
0answers
178 views

how to display json_encode via $wpdb

ive been struggling for quite a while how to make this work. i created a custom php, and used it as a template page. [below code] i also ended up with this link //localhost/site/?page_id=43 if i ...
2
votes
3answers
2k 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 ...
0
votes
1answer
2k views

Parse wordpress blog data using json api and ajax

I have seen lots of responses to how to extract data from wordpress blog posts using the json api plugin. Many uses $.getJSON, $.ajax, .responseData.feed.entries, success function() etc. What is the ...
1
vote
1answer
257 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
1answer
151 views

attachment media-template data model (data.size.url)

I'm trying to build a media library where users can choose pictures that are being retrieved from custom folders, which they can specify the basefolder of. I'd like to keep using as much WP ...
-1
votes
3answers
670 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 ...