# Single Use Hooks

replace_meta_template_tags($action) - Used to Replace the Meta Description, Keywords, and/or HTML page <title> for a page.

$action (string) - the value of the current page's 'action' $_GET variable, if any.  e.g.: action=searchresults

This function must return an array with one or more of the following keys set:

['keywords']

['description']

['title']

example for replacing the title and keywords on a specific page (search results):

<?php

function replace_meta_template_tags($action) {

if ($action =='searchresults'){

return array('title'=>'This is my custom Search Results page Title', 'keywords' =>'custom keywords rock');

}

else {

return array('title'=>'This is a non targeted custom page Title', 'keywords' =>'non targeted custom keywords rock');

}

}

?>


detect_mobile_browser($user_agent) - Hook function used to override internal mobile browser detection

This function must return an array with the key 'is_mobile' if you want to override the built in detection. To fall back to the built in detection return NULL.

$user_agent (string) - The User Agent being reported by the browser.

example:

<?php

function detect_mobile_browser($user_agent) {

//check user agent, If this is a Motorola Xoom, force it to use the mobile template

if(stripos($user_agent,'xoom build') !== FALSE){

return array('is_mobile'=>TRUE);

}

//If not the xoom then fall back to internal detection.

return NULL;

}

?>