Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions php/context/class-fieldmanager-context.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function is_valid_nonce() {
*
* @param mixed $old_value Optional. The previous value.
* @param mixed $new_value Optional. The new value for the field.
* @param object $fm Optional. The Fieldmanager field to prepare.
* @param object $fm Optional. The Fieldmanager_Field to prepare.
* @return mixed The filtered and sanitized value, safe to save.
*/
protected function prepare_data( $old_value = null, $new_value = null, $fm = null ) {
Expand All @@ -61,9 +61,9 @@ protected function prepare_data( $old_value = null, $new_value = null, $fm = nul
if ( null === $new_value ) {
$new_value = isset( $_POST[ $this->fm->name ] ) ? $_POST[ $this->fm->name ] : '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's revert this change for now, because we aren't fully certain it doesn't have unintended consequences.

}
$new_value = apply_filters( "fm_context_before_presave_data", $new_value, $old_value, $this );
$new_value = apply_filters( "fm_context_before_presave_data", $new_value, $old_value, $this, $fm );
$data = $fm->presave_all( $new_value, $old_value );
return apply_filters( "fm_context_after_presave_data", $data, $old_value, $this );
return apply_filters( "fm_context_after_presave_data", $data, $old_value, $this, $fm );
}


Expand Down Expand Up @@ -93,4 +93,4 @@ protected function render_field( $args = array() ) {
}
}

}
}