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 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

Can I list all installed plugins/versions and wp version from API

Yes, there is a way to get that information programmatically. WordPress Version Info The WordPress version exists as a global, but you can also get it using the get_bloginfo() function: global $wp_version; echo $wp_version; // OR $wordpress_version = get_bloginfo( ‘version’ ); echo $wordpress_version; Plugin Info For retrieving plugin info, use the get_plugins() function. You’ll need … Read more

Unset data in custom post type WordPress API (wp-json)

If possible, only the examples shown in internet is: function qod_remove_extra_data($data, $post, $context) { // We only want to modify the ‘view’ context, for reading posts if ($context !== ‘view’ || is_wp_error($data)) { return $data; } // Here, we unset any data we do not want to see on the front end: unset($data[‘author’]); unset($data[‘status’]); // … Read more

How to loop through JSON data in wordpress WP REST API

I managed to solve this and access the JSON data using a foreach loop: $json = lusso_posts(); #var_dump( $json ); #die(); foreach( $json as $post ) { $titles = $post->title; $images = $post->featured_image->guid; ?> <div class=”lusso-posts”> <div class=”image-container”><img src=”https://wordpress.stackexchange.com/questions/210472/<?php echo $images; ?>” /> </div> <h4><?php echo $titles; ?></h4> </div> <?php }

How to save new transients if query changes?

According to code in OP, the only thing that changes the result is the $tags variable. In this case, the easiste way to do the trick is make the $tags part of the transient name. function get_posts_by_tags($tags){ $transient=”rest-posts-” . md5(serialize($tags)); if(false === ($result = get_transient($transient))) { // the rest of yout function here … if … Read more

How do I use the WP REST API plugin and the OAuth Server plugin to allow for registration and login?

I know it’s a bit far fetched, but might help. For anyone looking for WP REST API implementation with JWT, here’s our solution. Add it to your function.php add_action(‘rest_api_init’, ‘wp_rest_user_endpoints’); /** * Register a new user * * @param WP_REST_Request $request Full details about the request. * @return array $args. **/ function wp_rest_user_endpoints($request) { /** … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)