پرش به محتویات

"Filter: bricks/filter/taxonomy_args"

آرگومان‌های ارسال شده به get_terms() را هنگام ایجاد گزینه‌هایی برای عناصر فیلتر مبتنی بر طبقه‌بندی (مانند چک باکس، رادیو، فیلترهای انتخاب) فیلتر می‌کند.

پارامترها

  • $args (array): Array of arguments for get_terms().
  • $element (object): The filter element instance.

نمونه استفاده

add_filter( 'bricks/filter/taxonomy_args', function( $args, $element ) {
    // Example: Exclude specific term IDs from the filter options
    $args['exclude'] = [ 1, 2, 3 ];

    return $args;
}, 10, 2 );