add general woocommerce_form_field filter

This commit is contained in:
Mike Jolley 2018-03-13 14:30:19 +00:00
parent 64f85346c0
commit 1dbf1bc1d8
1 changed files with 10 additions and 0 deletions

View File

@ -2326,8 +2326,18 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
$field = sprintf( $field_container, $container_class, $container_id, $field_html );
}
/**
* Filter by type.
*/
$field = apply_filters( 'woocommerce_form_field_' . $args['type'], $field, $key, $args, $value );
/**
* General filter on form fields.
*
* @since 3.4.0
*/
$field = apply_filters( 'woocommerce_form_field', $field, $key, $args, $value );
if ( $args['return'] ) {
return $field;
} else {