Merge pull request #19388 from woocommerce/update/12912

Add general woocommerce_form_field filter
This commit is contained in:
Claudiu Lodromanean 2018-03-13 09:46:58 -07:00 committed by GitHub
commit 075e4cb0f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {