Adding text/HTML before or after input in a from

Sometimes you need to insert text/HTML in the middle of the from between the inputs,

We have a set of actions to help you do that

 do_action( 'matador_application_before_field', $field, $args  );

do_action( "matador_application_before_field_type_$type" );

do_action( "matador_application_before_field_template_$template" );

do_action( "matador_application_before_field_name_$field" );

INPUT GOES HERE

do_action( "matador_application_after_field_name_$field" );

do_action( "matador_application_after_field_template_$template" );

do_action( "matador_application_after_field_type_$type" );

do_action( 'matador_application_after_field', $field, $args );

You can use any of the actions as a need in this example we are using the
“matador_application_before_field_name_$field action.

The $field in the action name needs to be replaced by the ID of the input in this example case is is “phone”

add_action( 'matador_application_before_field_name_phone', function() {

 echo "this is before the phone";

} );

add_action( 'matador_application_after_field_name_phone', function(){

   echo "this is after the phone";

} );

this will produce this output in the form

You would add this code to a (Child) theme function.php.

Was this article helpful?
Yes 0 No 0