WP API querying a custom post type and a custom field
WP API querying a custom post type and a custom field
WP API querying a custom post type and a custom field
rendering view in backbone
function custom_phrase($request_data) $request_data was missing. Fixed it 🙂
Woocommerce api: create product with images – bad request
You can hook into the rest api query and add your args from url’s parameters The code will look something like: function query_post_by_fields($args, $request) { $url_params = $request->get_param; //Modify $args with your url params return $args; } add_filter(‘rest_post_query’, ‘query_post_by_fields’, 10, 2); Docs: https://developer.wordpress.org/reference/hooks/rest_this-post_type_query/
How to show single category archive
First of all, it is not the fault of AndroidNetworking, it is the permission denied, which I figured out after testing Retrofit, Retrofit throws the error for the permission denied which led me to fix the problem. I checked above code after fixing the permission and it works very well. Thank you PS. There is … Read more
I took a lot of time – the whole night – trying to fix this “401: Sorry, you cannot list resources.” The solutions shared by many online are great although they did not work as stated for me. In my case, running my own VPS server, what worked for me was going to WHM then … Read more
The problem is, you are calling a static method from inside of a non-static method. The following will work. class theme_Rest_Routes extends WP_REST_Controller{ public static function init() { $instance = new self(); add_action( ‘rest_api_init’, array( $instance, ‘register_routes’ ) ); } public function register_routes() { register_rest_route( ‘theme/v1’, ‘/menu/’, array( ‘methods’ => ‘GET’, ‘callback’ => array( $this, … Read more
For anyone wondering the same thing, it turns out that you can use the woocommerce API with any normal authentication methods. WooCommerce includes two ways to authenticate with the WP REST API. It is also possible to authenticate using any WP REST API authentication plugin or method. This means I was able to use the … Read more