GravityKit/GravityView

Add a filter to the Cancel button in the search bar widget to add/modify an anchor

Closed this issue · 2 comments

The search button of the search bar uses the anchor specified in the form action to scroll the page to the correct place, but the cancel button doesn't have this functionality.

https://github.com/GravityKit/GravityView/blob/develop/includes/widgets/search-widget/class-search-widget.php#L1970-L1980

add_filter( 'gk/gravityview/widget/search/clear-button/params', function ( $params ) {
	$params['url'] .= '#some-hash';

	return $params;
} );