Questions tagged [json]

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is incorporated in WordPress through the REST-API.

Filter by
Sorted by
Tagged with
-1
votes
0answers
13 views

Fetch author in wordpress api

I am trying to make a mobile app(React-Native) for a Wordpress blog managed by someone I know. I am trying to fetch author details through the API. I have used the _embed option. However, the ...
0
votes
0answers
10 views

How to store and retrieve custom metabox data as json in wordpress api

I am trying to store metabox data as json in wordpress and then get it using wp-json api. What i tried $current = array( 'id' => "in json object", 'name' => 'name in json object' ); $...
2
votes
2answers
76 views

Disable REST API for a user ROLE

I'm looking for a way to disable Rest API for a user role called 'external_user' (disable wp-json queries.) This user role can see right now alot of posts and pages information with when we put wp-...
0
votes
0answers
18 views

How do i POST to WordPress rest API from the same domain?

I created a custom rest API route - > http://mydomain/wp-json/v1/wp/custom/user now this POST request to this route works perfectly from a remote host. Some things change in my dev env and the JS ...
0
votes
1answer
47 views

How to receive JSON payload from a digital device

I have a site with about 100 registered users. Some of the people will be receiving digital scales. The scales send their weight data to a 3rd party server that then sends a JSON Payload as an HTTP ...
0
votes
0answers
21 views

How to add and use a custom php script to WordPress REST API?

I have customized the WordPress rest API A bit and added the customization under functions.php. Currently, under ({{site}}/wp-content/themes/my-theme/js/Ajaxcall.js) I have a JS function that is ...
0
votes
0answers
12 views

how to fix CHARSET issue on wp_json_encode()

I am getting the wrong character when I use wp_json_encode() For example: $location_encode_data = array( 'city' => 'Zürich', ); $location_panel_json = wp_json_encode( $location_encode_data ...
0
votes
1answer
42 views

get all products of one category

i use this function to get all products of one category in ajax request function get_products() { $cat_id = $_POST['category']; $args = array( 'post_type' => 'product', '...
-1
votes
0answers
15 views

ACF field always returns empty on save post

So I'm trying to track prices of some products. I'm using a plugin to handle the scraping part. The idea is: new product gets added -> (empty) field with history of price gets price : date. Does the ...
0
votes
0answers
55 views

WP CLI in WP 5.3 with PHP 7.4

Working with the WP REST API WP-CLI in WP 5.4, by selecting PHP 7.3 the call to wp post works as usually: wp post list But changing to PHP 7.4 (current) throws me the following errors: Deprecated: ...
-1
votes
0answers
10 views

How do I add JSON object to Custom Field in Wordpress and send it to Firebase through Zapier?

I need to send a JSON object to Firebase whenever a new post is published in Wordpress. This JSON object will vary for each post. I've established a Zapier connection between Wordpress and Firebase. ...
0
votes
1answer
22 views

Remove escape characters from JSON string pulled from a database

I'm pulling rows that contain JSON content from a DB like this: <?php //get the data from the database global $wpdb; $current_user = wp_get_current_user(); $username = $...
0
votes
0answers
9 views

Post form data and localstorage data in Ajax request

I am creating a quote form. it works with basic info (name, email etc) now I would like to incorporate data that is stored in my localstorage (a bit like a shopping cart) The structure looks like ...
0
votes
1answer
18 views

How to get a custom entry field label with Gravity Forms?

I want to get a JSON object like [{"Video link": "https://www.youtube.com/watch?v=r",....},...] from form entries with "labels". Now I am using this code $form_id = '1'; $form = GFAPI::get_form( $...
0
votes
1answer
15 views

how to get json file in wordpress template

I am trying to get data from JSON file in Wordpress template using file_get_contents But can not get the file $data = file_get_contents("../assets/data2.json"); $arr = json_decode($data, true); ...
0
votes
0answers
5 views

Leave A Comment With Json Wordpress in Xcode

i made app with Xcode in swift using my Wordpress backend and getting data with json, i can show users comment on my app but i want that users can also leave comments in the app, there should be an ...
1
vote
0answers
14 views

wordpress json api not working

i want to show soon from my API, but it seems not working Below is my code add_action( 'rest_api_init', 'my_register_route' ); function my_register_route() { register_rest_route( 'my-route', '...
0
votes
1answer
10 views

How to check and get json object in WP database?

I need to check if an option value from database is a json object. This funtion following cannot work : function isJson( string $str, $is_assoc = true ){ json_decode( $str, $is_assoc ); ...
0
votes
0answers
22 views

Wordpress Using Zip code customer shop find without woocommerce plugin

How can i implement using zip code each and every single image we can add a zip code using search the customer shop. can you give me any suggestion. Using Zip Code and then give name of Dealer, ...
1
vote
1answer
149 views

Can't GET draft posts via REST API from headless frontend

I have a headless install of Wordpress on v5.4.0. The frontend can't GET any post that is in draft status, though when accessing the API url directly the data is returned without an issue. I'm ...
1
vote
0answers
88 views

How to use JSON data from URL into table on my wordpress website

I want to display a data into table format on my wordpress website from the data available from below two JSON URL's https://corona.lmao.ninja/all https://corona.lmao.ninja/countries?sort={parameter} ...
0
votes
0answers
26 views

Get wordpress post with featured image, category and tag from Wordpress API

I have to transfer data from Wordpress website to custom CMS ( I don' t have access to database), and I need to transfer post data (title, excerpt, content) along with featured image link and category ...
0
votes
0answers
12 views

How to add google ads in AMP Project Contributors

I am talking about this amp plugin in particular: https://wordpress.org/plugins/amp/ I manage to add googleanalytics works fine because it had documentation: But how to add adwords code or whatever ...
0
votes
1answer
26 views

Why WordPress not using JSON_UNESCAPED_UNICODE by default?

I found one strange thing related to JSON and depending on what site language using WordPress. For example, when Site Language is set to English and you viewing source code of the page, system ...
0
votes
1answer
29 views

Wordpress API “code”:“rest_no_route” with Custom Route

I am attempting to start creating a custom endpoint for one of my sites, so I can pull in ACF fields to another. I have the following code in my theme's functions.php // register the endpoints ...
0
votes
0answers
18 views

Add binary or json animation to wordpress site

I just created an animation with RIVE. There are options to export the animation as binary or json file. Is it someway possible to include my animation into my wordpress site?
0
votes
1answer
26 views

Hi everyone, I have Problem with using wp_die()

I have created a custom registration form in WordPress and everything works fine. The error handling and database operations also fine. The only problem is that the JSON response I return is printed ...
0
votes
1answer
76 views

Third-Party API - PHP Fatal Errors Paired with http_request_failed / cURL error 28

We've developed an integration with a series of APIs provided by a third-party into a child-theme of Divi. In functions.php of that child-theme, we've created a series of functions for the purpose of ...
0
votes
0answers
4 views

widget to xml/json

Newbie's question. have a post on my wordpress site that i need to have a representation of XML/JSON to a NEW url so I can grab data from another website. How do I do that? Any widget that can come ...
0
votes
0answers
19 views

Implementing URL JSON API Data into Website

I've recently been messing around with my own Game server, and I want to implement a status page on my website, so if the game Server ever goes down players have a place to go to find out what went ...
0
votes
2answers
409 views

How to include a JSON file on my page?

I have a JSON file stored in my child theme directory: file.json). Separately, the PHP template for my page contains some JavaScript code (in the form of a <script> tag). In that JS code, I ...
0
votes
1answer
42 views

Why wp_ajax hooks doesn't work?

I need to execute the Php function from my Ajax form with the POST method. Is there another way instead of ajax hooks? Hooks doesn't execute. Always returning 0. What's wrong? Here's my ajax.js '...
0
votes
1answer
45 views

ajax response strips multidimensional array and unable to decode

I am using the wp_ajax_ and wp_ajax_nopriv_ in localize script I am passing a big multidimensional array( it's big!). It works without any JSON encode, decodes. But I want to encode it is while I make ...
0
votes
0answers
13 views

Include dynamic generated pages in Wordpress search

I am creating 7-8 pages dynamically based on a JSON response from recruitee and want to include those pages in my search so that if someone is searching for "webdev" matching results are getting shown....
0
votes
1answer
19 views

Wordpress output data to another website and pull data

Would you like to ask, is it possible to send data from the WordPress website to another website, and get the data back from another website? I would like to make a function with text insert and a ...
-2
votes
1answer
26 views

How do i save this python code to text file.? [closed]

# Dependencies import json import requests # Specify the URL url = "https://official-joke-api.appspot.com/jokes/programming/ten" # Make request and store response r = requests.get(url) print("...
1
vote
0answers
30 views

Custom endpoint to get all custom taxonomy terms

I'm trying to build a custom endpoint to get all terms from custom taxonomy the taxonomy name is cats I'm using this code function wl_cats() { $args = [ 'numberposts' => ...
0
votes
1answer
14 views

Consult array data in REST API Filter

Is it possible to make a filter with REST API Filter or any other technology to discover all elements that have job_listing_category = 86? Since job_listing_category is an array. Actual state: https:/...
0
votes
0answers
47 views

Intergrate JSON into wordpress

is there an easy way to intergrate a JSON script in to Wordpress? I have a JSON API from a thirt party sorftware company which i have to use so customers can create an account on our site. Thanks in ...
0
votes
0answers
13 views

Single Post Pagination via REST API when post is split into multiple pages

Within a post you can use the <!--nextpage--> tag to split a single post into multiple pages. With the Rest API, you can get an entire single post by doing: http://example.com/wp-json/wp/v2/...
0
votes
0answers
166 views

Send a JSON Data from a Form in WP to external API

I made a form in WP but I need to send all the data from the form to an external API in JSON Data, but I don't know how to do that, I just need suggestion on how to do that.
1
vote
0answers
81 views

WordPress JSON data to and from database to be shown on rest point

I am building a plugin that retrieves YouTube videos for a given channel and stores them in the database. Once they are safe in the database I create a REST point which I can access than any time to ...
0
votes
1answer
23 views

How to display “META” array in register_taxonomy

How do I get the "META" field to go off "META: []" for something filled in? I am using this code: register_taxonomy( 'job_listing_category', 'job_listing', [ 'labels' => [ ...
0
votes
0answers
27 views

Loop through Wordpress API response errors

I am having trouble parsing my AJAX response from my WordPress API that my hybrid mobile app is making. Below is (one of many ways I have tried to parse the response all of which have not worked): ...
2
votes
1answer
57 views

Options to get my custom post type metadata via the WordPress API

I am using a plugin that adds multiple custom post types all of which have their own meta-data. I am able to expose the custom post type to WordPress's API but the metadata collected with those post ...
0
votes
1answer
74 views

Issue with json decode in Wordpress - value is not returning consistently

I have a json file I am displaying the contents of on my wordpress site. The issue stems from the fact that some of the values I'm returning I need to sort through later, and while that value is ...
0
votes
1answer
179 views

ACF save json to custom directory not working, default acf-json used instead

I am using Advance Custom Fields local json so I can synchronise my forms across different environments. See my function below, with var dump outputs in comments so you can see what is going on... ...
0
votes
0answers
14 views

using javascript templating with wordpress to save time on post updates without impacting seo or ux

I have one JSON file that contains the text content for my hundreds of Wordpress posts. I am using templating, mustache.js, to insert the text content and render the posts. This saves me a lot of time,...
0
votes
0answers
90 views

CRUD from WordPress to Business Central 365 through OData REST API

The goal here is to use WordPress as a front-end to create, read, update and delete data which is being pulled from Microsoft Dynamics 365 Business Central through OData Webservices in a JSON format. ...
0
votes
0answers
23 views

Run hook in functions.php from page link

I'm writing a small function that takes a json file (~1000 objects) and uploads every json object to WordPress posts. I only need to have it run once to migrate data from another system. I wrote the ...

1
2 3 4 5
9