@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function __construct() { |
| 27 | 27 | // hook the HTML ID string find & replace functionality |
| 28 | - add_filter( 'gform_get_form_filter', array( $this, 'gform_get_form_filter' ), 10, 2 ); |
|
| 28 | + add_filter('gform_get_form_filter', array($this, 'gform_get_form_filter'), 10, 2); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | * @param array $form Array with the form settings. |
| 40 | 40 | * @return string $form_string The modified form HTML string. |
| 41 | 41 | */ |
| 42 | - public function gform_get_form_filter( $form_string, $form ) { |
|
| 42 | + public function gform_get_form_filter($form_string, $form) { |
|
| 43 | 43 | // if form has been submitted, use the submitted ID, otherwise generate a new unique ID |
| 44 | - if ( isset( $_POST['gform_random_id'] ) ) { |
|
| 45 | - $random_id = absint( $_POST['gform_random_id'] ); // Input var okay. |
|
| 44 | + if (isset($_POST['gform_random_id'])) { |
|
| 45 | + $random_id = absint($_POST['gform_random_id']); // Input var okay. |
|
| 46 | 46 | } else { |
| 47 | 47 | $random_id = mt_rand(); |
| 48 | 48 | } |
@@ -98,11 +98,11 @@ discard block |
||
| 98 | 98 | ); |
| 99 | 99 | |
| 100 | 100 | // allow addons & plugins to add additional find & replace strings |
| 101 | - $strings = apply_filters( 'gform_multiple_instances_strings', $strings ); |
|
| 101 | + $strings = apply_filters('gform_multiple_instances_strings', $strings); |
|
| 102 | 102 | |
| 103 | 103 | // replace all occurences with the new unique ID |
| 104 | - foreach ( $strings as $find => $replace ) { |
|
| 105 | - $form_string = str_replace( $find, $replace, $form_string ); |
|
| 104 | + foreach ($strings as $find => $replace) { |
|
| 105 | + $form_string = str_replace($find, $replace, $form_string); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | return $form_string; |