How to replace an action

Easy Property Listings uses a number of hooks and actions to output the various listing elements into the templates. 

We have used actions which enable you to add to, replace and add after with your own custom code.

Lets take a look at how you can replace the default address action with a customised version where you need to add some custom html.

Many functions are contained in the  template-functions.php file. These functions use other functions inside the class-property-meta.php file. 

Search for the epl_property_the_address function inside the template-functions.php file. After the function you can see the actions that use this function when they appear in the templates.

add_action('epl_property_title','epl_property_the_address');
add_action('epl_property_tab_address','epl_property_the_address');
add_action('epl_property_address','epl_property_the_address');

Lets say you want to customise the address output in the epl_property_the_address function.

Create your new address function

First create a new function in your theme functions.php (good) file or a custom plugin (better).

function my_epl_property_the_address() {<br>// copy the contents of the epl_property_the_address <br>// function and put it in here and make your changes.<br>}<br>// Add your new actions<br>add_action('epl_property_title','my_epl_property_the_address');<br>add_action('epl_property_tab_address','my_epl_property_the_address'); <br>add_action('epl_property_address','my_epl_property_the_address');

Disable the default address functions

Use   remove_action to disable the default address actions.

remove_action('epl_property_title','epl_property_the_address');
remove_action('epl_property_tab_address','epl_property_the_address');
remove_action('epl_property_address','epl_property_the_address');