How to list all categories and tags in a page?

TERM METADATA It’s possible to get thumbnails for terms using the new Term Metadata in 4.4. You just also need to define those ahead of time yourself. add_term_meta( int $term_id, string $meta_key, mixed $meta_value, bool $unique = false ) get_term_meta( int $term_id, string $key = ”, bool $single = false ) update_term_meta( int $term_id, string … Read more

REST API: How can I restrict a custom post type to only be accessible by authenticated users?

Looks like I found a snippet that do exactly that. It’s from Daniel Bachhuber, the API developer. add_filter( ‘rest_authentication_errors’, function( $result ) { if ( ! empty( $result ) ) { return $result; } if ( ! is_user_logged_in() ) { return new WP_Error( ‘restx_logged_out’, ‘Sorry, you must be logged in to make a request.’, array( … Read more

Archive page with multiple taxonomies rewrite

ok, so I thought I’d come back and answer my own question in case its useful to someone else. To start, the CPT: ‘query_var’ => true, ‘has_archive’ => false, ‘rewrite’ => array( ‘slug’ => ‘resources’, ‘with_front’ => false ), Tax1: ‘query_vars’ => true, ‘rewrite’ => array( ‘slug’ => ‘resources/type’, ‘with_front’ => false ) Tax2: ‘query_vars’ … Read more