wpDiscuz 7 API Documentation

  1. Home
  2. Docs
  3. wpDiscuz 7 API Documentation
  4. Filters
  5. wpdiscuz_sorting_buttons_array
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

wpdiscuz_sorting_buttons_array

This filter is used for adding or deleting some items in sorting items

Changelog

Added in version 7.0.0

Parameters

1. $button (type: array) – the array of the sorting buttons

Usage

add_filter("wpdiscuz_sorting_buttons_array", function ($buttons) {
    $buttons[] = [
        "orderBy" => "comment_date",
        "order" => "desc",
        "class" => "wpdiscuz-custom-sort",
        "text" => "Custom",
        "type" => "custom",
    ];
    return $buttons;
});

Was this article helpful to you? Yes No