Extend the Plugin

We want to make this plugin as easily as possible extensible. In the current version, there are already some filter and actionhooks, where other plugins can hook into the plugins system in order to extend its functionality. Here you have an overview over the already existing possibilites:

NameFilterFunctionExampleLocation
Before Formsf-before-formIf you want to add something into the HTML of the Search-Form, then you can hook into with this filter.
<?php 
	add_filter( 'sf-before-form', 'myFunction' ); 
	function myFunction(){
		?>
		<p>This is our product search. Please 
		change the values and see, what products you 
		get</p>
		<?php
	}
?>
shortcode.php
After Formsf-after-formIf you want to add something into the HTML after the Search-Form, then you can hook into with this filter
<?php 
	add_filter( 'sf-after-form', 'myFunction' ); 
	function myFunction(){
		?>
		<p>Here comes my own text</p>
		<?php
	}
	?>
shortcode.php
After the results headsf-after-result-headThis Filter will be executed after the display of the search results head. It will be shown in any case, also, if no search was executed.
<?php 
	add_filter( 'sf-after-result-head', 'myFunction' ); 
	function myFunction(){
		?>
		<p>Here comes my own text</p>
		<?php
	}
?>
shortcode.php
After The Resultssf-after-resultsThis Filter will be executed after the display of the search results. It will be shown in any case, also, if no search was executed.
<?php 
	add_filter( 'sf-after-results', 'myFunction' ); 
	function myFunction(){
		?>
			<p>Here comes my own text</p>
		<?php
	}
?>
						
shortcode.php
After The Navigationsf-after-navigationThis Filter will be executed after the display of the search navigation. It will be shown in any case, also, if no search was executed.
<?php 
	add_filter( 'sf-after-navigation', 'myFunction' ); 
	function myFunction(){
		?>
		<p>Here comes my own text</p>
		<?php
	}
?>
						
shortcode.php
The Single Result Elementsf-results-single-resultThis Filter will be executed, for each result item. It passes the HTML-Code betwenn <li></li>
Example how to active Shortcodes with this filter
<?php 
	add_filter( 'sf-filter-args', 'myFunction' ); 
	function myFunction( $html ){
		$html .= '<div>Produly presented by ';
		$html .= get_bloginfo( 'name' ) . '<div>';
		return $html
	}
?>
						
ajax.php
After The Navigationsf-after-navigationThis Filter will be executed after the display of the search navigation. It will be shown in any case, also, if no search was executed.
<?php 
	add_filter( 'sf-after-navigation', 'myFunction' ); 
	function myFunction(){
		?>
		<p>Here comes my own text</p>
		<?php
	}
?>
						
shortcode.php
The Filter Argumentssf-filter-argsThis Filter will be executed, when all Arguments for the WP_Query() are gathered
<?php 
	add_filter( 'sf-filter-args', 'myFunction' ); 
	function myFunction( $args ){
		$args['posts_per_page'] = 5;
		return $args
	}
?>
						
ajax.php

© 2014, websupporter | Credits

This is a demo store for testing purposes — no orders shall be fulfilled.