Support

Account

Forum Replies Created

  • All right. Figured it out.
    Anyone needs to solve this: “all” doesn’t work (anymore?) but “custom” does the job and shows all events (upcoming and past).

    Here’s the updated code:

    function my_relationship_query( $args, $field, $post )
    {
        // add and define tribe events eventDisplay to 'all' since it's predifined only to future.
        $args['eventDisplay'] = 'all';
    
        return $args;
    }
    
    // acf/fields/relationship/result - filter for every field
    add_filter('acf/fields/relationship/query', 'my_relationship_query', 10, 3);
  • Thank you for sharing. But it doesn’t work for me. Is this really exactly the function you use?
    ‘past’ does work, but then it doesn’t show the upcoming events. ‘all’ however has no effect..

  • I think I found a solution. For anyone interested:

    <?php
        add_filter('acf/fields/taxonomy/wp_list_categories/name=test_tax2', 'my_taxonomy_args', 10, 2);
        
        function my_taxonomy_args( $args, $field )
        {
                $args['exclude'] = array(64,65,66); //the IDs of the excluded terms
            return $args;
        }
        ?>
  • Dear Leanda,

    Thank you for sharing. This works for me as a filter to exclude some categories from the field in the backend (I was looking for this, to give editors less choice when selecting categories for posts). But, I was looking for a way to do this on a field by field basis. Say, for the taxonomy field “test_tax1” exclude (or hide) the categories 64,65,66 and for the taxonomy field “test_tax2” exclude (or hide) the categories 67,68.

    Can you think of a way to do this?
    At the moment the categories are excluded (hidden) on all taxonomy fields of the regular wp categories.

Viewing 4 posts - 1 through 4 (of 4 total)