You’ll have to modify the code. Look in includes/WEBLIB_Patrons_Admin.php,
function checkiteminform() and change this code:
$newzip = $_REQUEST['zip'];
if (!($newzip != '' && (strlen($newzip) == 5 || strlen($newzip) == 10) &&
preg_match('/\d+(-\d+)?/',$newzip) )) {
$result .= '<br /><span id="error">'.__('Zip is invalid','web-librarian') . '</span>';
}
You should change the match pattern passed to preg_match to match Canadian
postal code formats.
and in the function display_one_item_form() there is this code fragment:
<tr valign="top">
<th scope="row"><label for="zip" style="width:20%;"><?php _e('Zip:','web-librarian'); ?></label></th>
<td><input id="zip"
name="zip"
style="width:75%;"
maxlength="10"
value="<?php echo $this->viewitem->zip(); ?>"<?php echo $ro; ?> /></td></tr>
You want to change the label for the field.
Thank you very much,
I will try this out and let everyone know if it works.
LibrarianTeddy, did you get this to work and if so could you share the first code block please? I am looking to do this for the UK and your code might give me a few clues.
I know how to change the label from zip to postal code.
Thanks
Hi, is there some way to do this change for example in functions.php in theme? I will have to do more changes, but I don´t want to lose them, when upgrading to higher version of the plugin.
Thanks
If you have many changes, your best option would be to ‘fork’ the plugin and have a local copy on your desktop computer. There is a plugin that lets you update a plugin from an uploaded Zip file — this is very handy.
It would then be easy to download and patch new versions with your changes.
This plugin: “Easy Theme and Plugin Upgrades” is handy for easy updates of plugins that you upload as a Zip file, rather than updating from the WP plugin repo. *I* use it with various ‘private’ plugins (and for my company website’s custom theme).
Thanks Robert!
Since asking this question I started to try to learn a bit of php and in the mean time, we found a work around solution for what we needed. But I think webLibrarian will be the superior long term solution, so when I have a chance I will try what you are suggesting and will let folks know how it went. Thanks for your continued support!