Authenticate + Authorize WP REST API request before built-in WP JSON Schema Payload Validation?

Alright, guess I figured it all out: Has WP Core been updated to do JSON Schema – based request argument validation automatically now? It seems that that’s the case, yes. If you provide a proper JSON schema, as shown in the example, when using register_rest_route, payload validation is executed automatically, without the provision of a … Read more

Password Protected Page + Showing Different Page If Not Authenticated/Authorized

As ialocin mentioned some requirements will require extra customizations. I can create a number of passwords to access the page You would create user accounts. Passwords don’t exist without users. An expiration date can be set for each password This isn’t implemented in wordpress and requires the most work. You could probably store a date … Read more

How to display archive page posts based on author_id

All you need is to use pre_get_posts action to hook to add author_id to the query based on your custom custom_user_id query var: add_action( ‘pre_get_posts’, ‘filter_by_custom_user_id’ ); function filter_by_custom_user_id( $query ) { // Apply only on frontend, for gallery post type archive, for main query and if custom_user_id query var is set. if( ! is_admin() … Read more

tech