wordpress-rest-api

Facebook Login With WP JWT Auth

徘徊边缘 提交于 2019-12-22 03:48:43
问题 We are using WP JWT Auth plugin to login user to WordPress from wp rest API. WP JWT Auth plugin requires a password to get the token, now when we are integrating facebook login, I am not sure how to get the user logged in since we won't be having passwords from facebook. Any suggestions? 回答1: Yesterday I opened a bounty for your question and today I'm answering it! You will need two WordPress plugins: stionic users and nextend social login (you need to configure it on order for stionic to

Only have access to method “GET” in WP REST API - others return 401

ぐ巨炮叔叔 提交于 2019-12-13 06:28:14
问题 I'm working with the Wordpress REST API and have the following issue: When I try to make a "POST" or "DELETE" request I get a 401 error - even for the standard endpoints like "wp-json/wp/v2/posts". Locally it works without any problems, but on my webserver it doesn't. Here's the response from when I try to make a "POST" request to the server: { "code": "rest_cannot_create", "message": "Sorry, you are not allowed to create new posts.", "data": { "status": 401 } } ... and the HEADERS: Access

Get custom posts using the WP REST API

ぐ巨炮叔叔 提交于 2019-12-13 03:16:14
问题 I'm trying to get custom post types, but I can not seem to find any solution. The WP REST API documentation only returns blog posts. Note: I'm using the Dooplay theme The code below is in the file tipo.php directory: inc > includes > series if( ! function_exists( 'doo_series' ) ) { function doo_series() { $labels = array( 'name' => _x('TV Shows', 'Post Type General Name','mtms'), 'singular_name' => _x('TV Show', 'Post Type Singular Name','mtms'), 'menu_name' => __d('TV Shows %%PENDING_COUNT

Wordpress Rest API - Custom Fields

梦想与她 提交于 2019-12-12 05:59:10
问题 I have created a custom post type in Wordpress and exposed it to rest API. I have also added custom fields to this post using the ACF plugin. In my themes function.php I have registered these fields in the response and I can see them when I make a get request. register_rest_field('auto', 'specs', array('get_callback' => 'get_autos_specs_for_api')); The problem is that when I send a post request, wordpress doesn't recognize these fields. It creates a new post with the title and all the extra

How to access the WP REST-API from any javascript file enqueued on Wordpress?

无人久伴 提交于 2019-12-12 05:39:43
问题 How to access the WP REST-API directly to read and write any public/private data from any javascript file enqueued in Wordpress? 回答1: The NODE-WPAPI Client Authentication and Global Handle provides an easy hassle-free answer to this problem. Check out: https://somefunagba.github.io/node-wpapi-auth/ Go to Plugins Dashboard. Activate ‘NODE-WPAPI JS-CLIENT Install and Authentication’ The Plugin is now activated, under it are the links: Settings | Deactivate | Edit Click on this Settings link

Post request to custom end point

只愿长相守 提交于 2019-12-12 04:27:55
问题 I wish to make a post request to a remote site but so that it updates remote site with data from database. I succeeded in getting the data using get request from database of current site but am unable to create a callback function for the post request. This is my code function register_custom_route(){ register_rest_route( 'silentblast-dashboard/v1', '/getsetting/(?P<id>\d+)', array( array( 'methods' => 'GET', 'callback' => 'retrieve_settings_data', ), array( 'methods' => 'POST', 'callback' =>

Wordpress REST API - send reset password link

空扰寡人 提交于 2019-12-11 06:09:55
问题 I want to create a request from my application. (iOS and Android - Coded with Xamarin). Explaination: The request should trigger the WordPress action=lostpassword . - The user receives an email to reset his password in browser. OR The user will be able to set a new password. WordPress send a link to email - where the user has to verify, that he changed the password. Is there any chance to do this with a request to the REST API. Maybe any similar ideas? I have already tried: Plugins where

WooCommerce REST API include attributes or custom fields in search

我的未来我决定 提交于 2019-12-11 04:45:44
问题 I need an extended search functionality available via REST API - mainly an ability to include product's attributes in a search query. I've seen a lot of similar questions but none of them are answered unfortunately. Is this even possible? And if so, any advice how or where I could modify the search query to include the product's attributes? 来源: https://stackoverflow.com/questions/38201510/woocommerce-rest-api-include-attributes-or-custom-fields-in-search

Cannot get images to upload to wp/v2/media with React Native

谁说我不能喝 提交于 2019-12-08 10:52:51
问题 I've been all over here and https://github.com/WP-API/WP-API/ and https://wordpress.org/ and cannot find anyone talking about this. I can get it working using postman and selecting the file, however i cannot get it work submitting it as either "multipart/form" or "image/png". I also cannot find anything detailing exactly how the request should look. I can create attachments but they're empty images of the correct size using base64 data as the post body. I feel like I'm missing something

Can I use the REST API for a site hosted on WordPress.com [closed]

╄→尐↘猪︶ㄣ 提交于 2019-12-05 13:57:35
I have a blog hosted on WordPress.com. When I try to make a GET request to retrieve the posts I get a 'Not Found' html page. https://alexkojin.wordpress.com/wp-json/wp/v2/posts I know about the legacy public API but it doesn't allow me to retrieve private posts. Can I use the REST API for site hosted on WordPress.com? On the WordPress.com platform the REST API is actually hosted and structured at https://public-api.wordpress.com/wp/v2 for all sites . In addition, there's a /sites/ endpoint that will namespace your specific site. For example, the root endpoint for your site would be https:/