Skip to content

Commit

Permalink
Merge pull request #3577 from WordImpress/issue/3542v2
Browse files Browse the repository at this point in the history
fix(admin-settings): refactor setting API to have custom save logic for setting sections #3541
  • Loading branch information
ravinderk committed Aug 8, 2018
2 parents 7852e3b + a60bc59 commit 36aff36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion includes/admin/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,17 @@ public static function get_option( $option_name = '', $field_id = '', $default =
$option_value = get_option( $option_name, $default );
}

return $option_value;
/**
* Filter the option value
*
* @since 2.2.3
*
* @param mixed $option_value
* @param string $option_name
* @param string $field_id
* @param mixed $default
*/
return apply_filters( 'give_admin_field_get_value', $option_value, $option_name, $field_id, $default );
}

/**
Expand Down
8 changes: 4 additions & 4 deletions includes/admin/emails/class-email-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ public function preview_email() {
}

// Set form id.
$form_id = empty( $_GET['form_id'] ) ? null : absint( $_GET['form_id'] );
$form_id = empty( $_GET['form_id'] ) ? null : absint( $_GET['form_id'] );

// Call setup email data to apply filter and other thing to email.
$email->send_preview_email( false );

// Decode message.
$email_message = $email->preview_email_template_tags( $email->get_email_message( $form_id ) );

// Set email template.
Give()->emails->html = true;
Give()->emails->__set( 'template', $email->get_email_template( $form_id ) );
// Show formatted text in browser even text/plain content type set for an email.
Give()->emails->html = true;

Give()->emails->form_id = $form_id;

if ( 'text/plain' === $email->config['content_type'] ) {
Expand Down

0 comments on commit 36aff36

Please sign in to comment.