woocommerce_form_field hook. Closes #633.

This commit is contained in:
Mike Jolley 2012-02-15 17:57:12 +00:00
parent 162722ba84
commit 1454a7a989
2 changed files with 8 additions and 2 deletions

View File

@ -102,6 +102,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
* Fixed category widget hierarchy
* Password error on checkout
* Improved install process
* Hookable woocommerce_form_field
= 1.4.2 - 09/02/2012 =
* Uninstall fix

View File

@ -730,7 +730,7 @@ if (!function_exists('woocommerce_form_field')) {
</p>'.$after;
break;
default :
case "text" :
$field = '<p class="form-row '.implode(' ', $args['class']).'" id="'.$key.'_field">
<label for="'.$key.'" class="'.implode(' ', $args['label_class']).'">'.$args['label'].'</label>
@ -738,8 +738,13 @@ if (!function_exists('woocommerce_form_field')) {
</p>'.$after;
break;
default :
$field = apply_filters( 'woocommerce_form_field_' . $args['type'], '', $key, $args, $value );
break;
endswitch;
if ($args['return']) return $field; else echo $field;
}
}