custom REST endpoints and application passwords

If you want to use application passwords to authenticate requests to your RESTful endpoints, you can modify your permission_callback function to check for the presence and validity of an application password instead of a user’s credentials. To do this, you can use the wp_check_application_passwords function, which was introduced in WordPress 5.6. This function takes an … Read more

Get Comment Text via REST API

A brief introduction and what does wp.apiRequest() return wp.apiRequest() is one of the three JavaScript API written by WordPress (the other two JavaScript APIs are the Backbone JavaScript Client and wp.apiFetch()), which we can use to communicate with the WordPress REST API, and as for wp.apiRequest(), it uses jQuery.ajax() which returns a jqXHR object that … Read more

Using the REST API filter, including two meta_queries breaks the response for one custom post type

Oddly, the cause of the problem seems to be the quotation marks around the comparison parameter. For example filter[meta_query][0][compare]=%27=%27 now needs to be filter[meta_query][0][compare]==. When only matching one meta value, this is not necessary, when matching two, this is, now, necessary. :/ Update: I realised that my hosting provider changed the version of Linux on … Read more

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