Skip to content

Commit 9c3efc6

Browse files
Remove stripslashes and add filter doc
1 parent 578e2d2 commit 9c3efc6

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

includes/class-form-manager.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,13 @@ public function form( $atts = array(), $content = '' ) {
192192
// allow plugins to add form fieldsq
193193
do_action( 'mc4wp_before_form_fields', 0 );
194194

195-
// allow plugins to alter form content
195+
/**
196+
* @filter mc4wp_form_content
197+
* @param int $form_id The ID of the form that is being shown
198+
* @expects string
199+
*
200+
* Can be used to customize the content of the form mark-up, eg adding additional fields.
201+
*/
196202
$content .= apply_filters( 'mc4wp_form_content', $form_markup );
197203

198204
// allow plugins to add form fields
@@ -232,6 +238,7 @@ public function form( $atts = array(), $content = '' ) {
232238
*/
233239
private function get_form_message_html( $form_id = 0 ) {
234240

241+
// don't show message if form wasn't submitted
235242
if( ! is_object( $this->form_request ) ) {
236243
return '';
237244
}

includes/class-form-request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ private function format_groupings_data( $data ) {
175175
if ( is_numeric( $grouping_id_or_name ) ) {
176176
$grouping['id'] = $grouping_id_or_name;
177177
} else {
178-
$grouping['name'] = stripslashes( $grouping_id_or_name );
178+
$grouping['name'] = $grouping_id_or_name;
179179
}
180180

181181
// comma separated list should become an array
182182
if( ! is_array( $groups ) ) {
183183
$groups = explode( ',', $groups );
184184
}
185185

186-
$grouping['groups'] = array_map( 'stripslashes', $groups );
186+
$grouping['groups'] = $groups;
187187

188188
// add grouping to array
189189
$sanitized_data[] = $grouping;

0 commit comments

Comments
 (0)