Support

Account

Home Forums ACF PRO Choose wordpress tags shown in ACF field taxonomy (= do not show every term) Reply To: Choose wordpress tags shown in ACF field taxonomy (= do not show every term)

  • Ok, I added those line in wp-config.php:

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    
    // Disable display of errors and warnings
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );

    I can see it’s working because the debug.log was created and is being filled with error messages.

    I added your error_log snippet directly under the function start:

    function my_taxonomy_query( $args, $field, $post_id ) {
      error_log('My Filter Was Called');
        // modify args
        $args['orderby'] = 'count';
        $args['order'] = 'ASC';
        $args['include'] = '589,186'; // list of terms to include
        // return
        return $args;
        }
    add_filter('acf/fields/taxonomy/query/name=ti_tag_test', 'my_taxonomy_query', 10, 3 );

    Not sure about this position though.

    So far, nothing like ‘My Filter Was Called’ in the error_log.