New answers tagged

1

If you want a parameter to be required for a post type's REST API endpoint you can use the rest_{$this->post_type}_collection_params filter to filter the $args of the GET endpoint: add_filter( 'rest_car_collection_params', function( array $query_params ) { $query_params['visible_to']['required'] = true; return $...


0

In turns out we had a caching plugin enabled that was getting in the way of some requests but not others, leading to this inconsistency.


0

A fairly simple way to do this is add in a function that says: When your post is published... Get your category's id/slug/etc... Save it as a custom meta value for your post And then, in your loop, order your posts by that meta value. So: // 1 add_action( 'publish_post', 'save_and_add_meta' ); function save_and_add_meta($post_id){ //Temporarily ...


0

I discovered Infinite Scroll has an updateurl function: var nextURL; function updateNextURL( doc ) { nextURL = $( doc ).find('.tax-pages a.next').attr('href'); } // get initial nextURL updateNextURL( document ); // init Infinite Scroll var $container = $('#main').infiniteScroll({ // use function to set custom URLs path: function() { return ...


0

Although the answer of Marcus solves the majority of the problem, be aware that it is not a complete solution. The answer of chifliiiii is more complete but like mentioned in the comments it's not reusing the already existing tags taxonomy. According to the OP, a solution must use "the tag taxonomy" and not "a tag taxonomy". Thus that's ...


0

The meta is within the taxonomy (so I have the standard, category name, slug, description etc and then I added a collectable tickbox to the category itself not the post/product) I solved this by Running a query for all sub categories and then I put an if statement in so it shows only categories with the collectable box ticked. (used toolset for the custom ...


0

Try using the below code to overwrite arguments of already registered taxonomies. function wp_modify_taxonomy() { // get the arguments of the already-registered taxonomy $custom_category_args = get_taxonomy( 'genre' ); // make changes to the args $custom_category_args->rewrite['slug'] = 'chambers'; $custom_category_args->rewrite['...


0

I'm a bit late. You can use "show_count" => 1 as args in wp_tag_cloud and you will see your term count against its name. :-) Enjoy


0

If you are using Google Chrome press Ctr+Shift+I and press the "Add New Featue" button in your page. See in Console and Network for errors.


0

WordPress taxonomy provides flexibilities to set its properties while registering it. To disable WordPress taxonomy archives, set "public" as "false" as shown in below example code. This will remove "View" action link from taxonomy screen and also redirect the user to website homepage when trying to access url of taxonomy ...


0

This always works fine. ref: https://developer.wordpress.org/plugins/post-types/registering-custom-post-types/ /** * Create taxonomies tag for CPT portfolio */ if ( ! function_exists( 'ns_register_team_category' ) ) { function ns_register_team_category() { $labels = array( 'name' => __( 'Tags', 'ns' ), 'singular_name' => __( 'Tag', 'ns' ), ...


1

This blog post by "Gazchap" deals with exactly the situation you are, and they updated it after publishing to your follow-up problem: Fortunately, version 4.4 of WordPress introduced a filter – post_edit_category_parent_dropdown_args – that could be used to control the parent terms shown in these meta boxes. It’s designed to let the developer ...


Top 50 recent answers are included