• Resolved denialorcoped

    (@denialorcoped)


    I have two questions about customizing the sorting dropdown in WPAdverts:

    1. Is there a way to remove certain options from the sorting dropdown? For example, my site doesn’t use prices, so I’d like to remove any price-related sorting options.
    2. Currently, when you open the sorting dropdown and want to close it, you have to click specifically on the “Publish Date” text. It would be much better for user experience if clicking anywhere outside the dropdown could close it, similar to how most standard dropdowns behave.

    Could you please let me know if these customizations are possible?

    Thanks very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    You can remove the options you do not want to use with the adverts_list_sort_options filter, for example to remove anything price related add the code below in your theme functions.php file (or even better create a new blank plugin and paste the code there https://wpadverts.com/blog/how-to-use-code-snippets-in-wordpress/).


    add_filter( "adverts_list_sort_options", function( $so ) {
    unset( $so["price"] );
    return $so;
    } );

    Changing how/when the dropdown closes is not possible right now but i will add this issue to our issue tracker and it should be changed in one of next releases

    Thread Starter denialorcoped

    (@denialorcoped)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.