Skip to content

Commit

Permalink
Fix save routine for source statement formats.
Browse files Browse the repository at this point in the history
See #1206.
  • Loading branch information
boonebgorges committed Dec 14, 2024
1 parent b6f6df1 commit df8ef58
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Core/Admin/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,19 @@ public function pf_options_admin_page_save() {
update_option( 'pf_source_statement_position', 'no' );
}

foreach ( [ 'pf_source_format_with_publication', 'pf_source_format_without_publication' ] as $format_var ) {
if ( isset( $_POST[ $format_var ] ) ) {
$format_value_submitted = sanitize_text_field( wp_unslash( $_POST[ $format_var ] ) );
update_option( $format_var, $format_value_submitted );
} else {
update_option( $format_var, '' );
}
// 'Source' statement formats.
$formats = pressforward_source_statement_formats();

if ( isset( $_POST['pf_source_format_with_publication'] ) ) {
$formats['with_publication'] = sanitize_text_field( wp_unslash( $_POST['pf_source_format_with_publication'] ) );
}

if ( isset( $_POST['pf_source_format_without_publication'] ) ) {
$formats['without_publication'] = sanitize_text_field( wp_unslash( $_POST['pf_source_format_without_publication'] ) );
}

update_option( 'pf_source_statement_formats', $formats );

$pf_archive_org_enabled = ! empty( $_POST['pf-archive-org-enabled'] ) && 'on' === sanitize_text_field( wp_unslash( $_POST['pf-archive-org-enabled'] ) ) ? 'on' : 'off';
update_option( 'pressforward_archive_org_enabled', $pf_archive_org_enabled );

Expand Down

0 comments on commit df8ef58

Please sign in to comment.