Skip to content

Commit

Permalink
Merge pull request woocommerce#19388 from woocommerce/update/12912
Browse files Browse the repository at this point in the history
Add general woocommerce_form_field filter
  • Loading branch information
claudiulodro authored Mar 13, 2018
2 parents 64f8534 + 1dbf1bc commit 075e4cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions includes/wc-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2326,8 +2326,18 @@ function woocommerce_form_field( $key, $args, $value = null ) {
$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 {
Expand Down

0 comments on commit 075e4cb

Please sign in to comment.