I am trying to add the following code as a PHP snippet however I am always getting a 403 forbidden error. This is happening on different test sites as well.
Do you know what may be the cause in the code?
// Open numeric keypad on mobile for number and quantity fields.
add_filter( 'gform_field_content', function( $content, $field, $value, $lead_id, $form_id ) {
if ( wp_is_mobile() && ( $field instanceof GF_Field_Number || $field instanceof GF_Field_Quantity ) ) {
$content = str_replace( "type='", "inputmode='decimal' type='", $content );
}
return $content;
}, 10, 5 );