Unrendered content Cornerstone through REST API

This is expected, as it depends on the context. The raw content will show up for the edit but not the view or embed context. It’s filtered through the WP_REST_Controller::filter_response_by_context() method. You can always add a new field to the response with register_rest_field() where the get_callback callback receives an input array with post data, including … Read more

Gutenberg internal page link search box

I found a solution and thought to post it here as others might need it el(URLInput, { className: props.className, value: attributes.linkURL, placeholder: i18n.__(‘Set the specific url’), onChange: function( url ) { props.setAttributes({ linkURL: url }); } }) Does exactly what I need.

WP API : date_query parameter

As of WP >= 4.7 filter[] is not supported and have been removed. Also WP REST API Plugin became part of WordPress Core. According docs your link should be: https://wptest.enguerranweiss.com/wp-json/wp/v2/posts?orderby=date&order=desc&after=2016-10-13T17:00:00 EDIT As enguerranws mentioned the date should be in ISO8601 format

How to get the attached gallery in the rest API?

To my knowledge this can’t be done out of the box. So you could make use of what get_post_galleries() or get_post_gallery(), the latter is just making use of the former, are doing by adding an endpoint. A minimal example could look like shown below. function rest_get_post_gallery( $data ) { //set FALSE for data output $gallery … Read more

WordPress REST API 404

I commented this, for my situation: I have this same issue. I’m on an Ubuntu-server, but I’ve simply pointed my host-file to point to the IP. I must admit I’m not 100% sure how the restful API works, if that has any effect or not. I’m on WP version 4.9.8, – and have the problem … Read more

Theme Options page with tabs

The do_settings_section() function call needs to correspond to the $optiongroup argument you pass to register_setting(). To see how all of the myriad functions fit together, see page 10 of my tutorial. It does get fairly confusing trying to follow how the various functions string together. EDIT: You do appear to be using the option group … Read more

POST to a REST API from a wordpress form

I don’t know of a plugin that does it in a general way; for the most part, you’ll need to build something custom for each specific API you intend to communicate with. For your purposes, the key function will be wp_remote_post(), which is a wrapper for the POST method of WP’s HTTP class. (Use this … Read more

Does the REST API (official) support custom post types?

Thanks for the clarification in the comments. The confusion is between the WordPress.com hosted API and the WordPress.org REST API project, which are different. The WordPress.com API was developed by Automattic and is only available for websites hosted on the WordPress.com platform. There’s some overlap in functionality, but that’s not the documentation you’re looking for … Read more

How do I retrieve a list of popular plugins using the WordPress.org Plugin API?

I was wrong in the earlier version of the answer and 1.1 version of the API does support this via GET request. The basic request would be: https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[browse]=popular And you can add more parameters by sticking with request passed as “array” (in GET interpretation of). See the [poor] documentation in Codex and links from there … Read more

API integration with WordPress

Something like this works: $url=”https://xxx”; $body = array( ‘auth_token’ => ‘xxxxxx’, ‘list_id’ => ‘xxxxx, ‘name’ => ‘Office’, ‘campaign_id’ => ‘xxxxx’, ); $response = wp_remote_post($url, array( ‘body’=>$body, ‘sslverify’ => false // this is needed if your server doesn’t have the latest CA certificate lists ) ); if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response … Read more