I need to add a php function and am a little confused on how to implement it properly.
The function is: fn_text_space_to_underscore
It is used when the admin uploads an image (a logo) for the feature 'Manufacturer' to make sure a space in the file name is replaced with an underscore.
I created app/addons/my_changes/func.php with the code:
<?php
if (!defined('BOOTSTRAP')) { die('Access denied'); }
function fn_text_space_to_underscore($text)
{
if (AREA == 'A') {
$text = preg_replace("/\s/" , "_" , $text);
return $text;
}
}
I think I need to create app/addons/my_changes/init.php to include the function in the site. But, not sure how. Appreciate any help.