Free Directory, Listing & Classifieds WordPress Plugin Support Themes ListingHive Remove attribute “date” from filter ?

Remove attribute “date” from filter ?

  • Author
    Posts
  • Tommy

    Date attribute is the only that you can’t manage. Because it comes by default, not in the WordPress User Interface (attribute block).

    Example

    It can be removed from filter options ? How can you get this ?

    Tommy

    It can be removed from filter options ? –> I meant, sort options. Sorry for the conceptual error.

    ihor developer

    Unfortunately there’s no way to remove it at the moment (it’s the default option), it changes to “relevance” in search. It’s possible to rename it using Say What or Loco Translate plugin.

    Tommy

    Thanks for the info ihor.

    Question: What is the text context of this value date ?. The text domain is listinghive.

    ihor developer

    Please try setting the hivepress text domain. There’s a code snippet that may be a better solution, I’ll post it on Monday (currently I don’t have access to my laptop, I’m on vacation).

    Tommy

    Ihor please, can you publish the snippet code ?

    Because I tried and it doesn’t work ( I dont’ have the text context ) using the plugin.

    ihor developer

    Please try using this code snippet, it replaces the “Date” and “Relevance” option texts with a custom text:

    add_filter(
    	'hivepress/v1/forms/listing_sort',
    	function( $args ) {
    		$args['fields']['_sort']['options'][''] = 'any text or a hyphen here';
    
    		return $args;
    	},
    	1000
    );

    You can add it to a child theme’s functions.php file so if you update ListingHive customizations will not be erased.

    Tommy

    Thanks ihor, the script works fine.

    I hope that in some future version we can remove / change names of the default attributes, because as we do not create them, their values ​​cannot be managed.

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

The topic ‘Remove attribute “date” from filter ?’ is closed to new replies.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.