Hi,
I found the following developer hook to customize signature options:
add_filter( 'frm_sig_output_options', 'sig_output_options' ); function sig_output_options( $options ) { $options['bgColour'] = 'transparent'; return $options; }
However it doesn't show what other options there are to set...
I would like to set the line colour of the signature.
Anyone have a list of all the posible options names that I can set like this? THx!
The filter actually has 2 parameters:
apply_filters( 'frm_sig_output_options', $signature_output, array( 'field' => $field ) );
The Formidable developers only exposed the background color for you to change, but when you look at the code, the $signature_output merged to an unexposed array named $signature_opts with the PHP array_merge function.
https://www.php.net/manual/en/function.array-merge.php
These are the important features of array_merge:
"Merges the elements of one or more arrays together so that the values of one are appended to the end of the previous one. It returns the resulting array.
If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. If, however, the arrays contain numeric keys, the later value will not overwrite the original value, but will be appended."
The good news is that the Formidable developers use string keys to define the elements of the $signature_opts array, which means you can override any of those values by adding an identical element to your filter.
These are the values in $signature_opts:
$signature_opts = array(
'id' => $field->id,
'width' => $values['size'],
'height' => $values['max'],
'line_top' => round( $values['max'] * 0.7 ) + 0.5, // use .5 for crisp line.
'line_margin' => $values['size'] * 0.05,
'line_color' => $border_color,
'line_width' => $hide_tabs ? 0 : 1,
);
I hope this helps.
Thx for that.... I tried with line_color however it doesn't seem to influence the drawing line.
Anyway, I made the background image (that I've set to draw over) a different color, so now the drawing line is showing ok, eventhough I didn't change it's color.
If someone does get it to work, do let me know!.. just curious 😉
Please login or Register to submit your answer