Skip to content

Commit

Permalink
deploy: ff9dc77
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Sep 25, 2024
1 parent 8b733a0 commit 88dded4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion mc_save_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ <h5>Parameters:</h5>



<td class="description last"><p>POST global.</p></td>
<td class="description last"><p>Sanitized POST global.</p></td>
</tr>


Expand Down
10 changes: 5 additions & 5 deletions my-calendar-categories.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
if ( isset( $_GET['default'] ) &amp;&amp; is_numeric( $_GET['default'] ) ) {
mc_update_option( 'default_category', (int) $_GET['default'] );
$default_category = (int) $_GET['default'];
mc_show_notice( __( 'Default Category Changed', 'my-calendar' ) );
mc_show_notice( __( 'Default Category Changed', 'my-calendar' ), true, false, 'success' );
}

if ( isset( $post['mode'] ) &amp;&amp; 'add' === $post['mode'] ) {
Expand All @@ -193,7 +193,7 @@

if ( $cat_id ) {
$append = implode( ' ', $append );
mc_show_notice( __( 'Category added successfully', 'my-calendar' ) . ". $append" );
mc_show_notice( __( 'Category added successfully', 'my-calendar' ) . ". $append", true, false, 'success' );
} else {
mc_show_error( __( 'Category addition failed.', 'my-calendar' ) );
}
Expand All @@ -218,9 +218,9 @@
mc_update_option( 'default_category', '' );
}
if ( $results &amp;&amp; ( $cal_results || $rel_results ) ) {
mc_show_notice( __( 'Category deleted successfully. Categories in calendar updated.', 'my-calendar' ) );
mc_show_notice( __( 'Category deleted successfully. Categories in calendar updated.', 'my-calendar' ), true, false, 'success' );
} elseif ( $results &amp;&amp; ! $cal_results ) {
mc_show_notice( __( 'Category deleted successfully. Category was not in use; categories in calendar not updated.', 'my-calendar' ) );
mc_show_notice( __( 'Category deleted successfully. Category was not in use; categories in calendar not updated.', 'my-calendar' ), true, false, 'success' );
} elseif ( ! $results &amp;&amp; $cal_results ) {
mc_show_error( __( 'Category not deleted. Categories in calendar updated.', 'my-calendar' ) );
}
Expand Down Expand Up @@ -260,7 +260,7 @@
$results = mc_update_cat( $update );
$append = implode( ' ', $append );
if ( $results || '' !== trim( $append ) ) {
mc_show_notice( __( 'Category edited successfully.', 'my-calendar' ) . " $append" );
mc_show_notice( __( 'Category edited successfully.', 'my-calendar' ) . " $append", true, false, 'success' );
} else {
mc_show_error( __( 'Category was not changed.', 'my-calendar' ) . " $append" );
}
Expand Down
2 changes: 1 addition & 1 deletion my-calendar-event-editor.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
$url = urldecode( sanitize_text_field( $post['ref'] ) );
// A link to the main calendar is always shown. Only show this if it was a different calendar.
if ( mc_get_uri() !== $url ) {
mc_show_notice( "&lt;a href='" . esc_url( $url ) . "'>" . __( 'Return to Calendar', 'my-calendar' ) . '&lt;/a>', true, false, 'info' );
mc_show_notice( "&lt;a href='" . esc_url( $url ) . "'>" . __( 'Return to Calendar', 'my-calendar' ) . '&lt;/a>' );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion my-calendar-location-manager.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
);
// Translators: Delete link.
$notice = sprintf( __( 'Are you sure you want to delete this location? %s', 'my-calendar' ), '&lt;a class="button delete" href="' . esc_url( add_query_arg( $args, admin_url( 'admin.php?page=my-calendar-location-manager&amp;mode=delete&amp;confirm=true' ) ) ) . '">' . __( 'Delete', 'my-calendar' ) . '&lt;/a>' );
mc_show_notice( $notice );
mc_show_notice( $notice, true, false, 'warning' );
}
}
if ( isset( $_GET['default'] ) &amp;&amp; is_numeric( $_GET['default'] ) ) {
Expand Down
6 changes: 3 additions & 3 deletions my-calendar-locations.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
do_action( 'mc_delete_location', $results, $location );
if ( $results ) {
$value = true;
$return = mc_show_notice( __( 'Location deleted successfully', 'my-calendar' ), false );
$return = mc_show_notice( __( 'Location deleted successfully', 'my-calendar' ), false, false, 'success' );
$default_location = mc_get_option( 'default_location', false );
if ( (int) $default_location === $location ) {
mc_update_option( 'default_location', '' );
Expand Down Expand Up @@ -490,7 +490,7 @@
);
$edit_url = add_query_arg( $args, admin_url( 'admin.php?page=my-calendar-locations' ) );
// Translators: Link to edit new location.
mc_show_notice( sprintf( __( 'Location added successfully. &lt;a href="%s">Edit location.&lt;/a>', 'my-calendar' ), $edit_url ) );
mc_show_notice( sprintf( __( 'Location added successfully. &lt;a href="%s">Edit location.&lt;/a>', 'my-calendar' ), $edit_url ), true, false, 'success' );
} else {
mc_show_error( __( 'Location could not be added to database', 'my-calendar' ) );
}
Expand Down Expand Up @@ -544,7 +544,7 @@
} elseif ( 0 === $results ) {
mc_show_error( __( 'Location was not changed.', 'my-calendar' ) );
} else {
mc_show_notice( __( 'Location edited successfully', 'my-calendar' ) );
mc_show_notice( __( 'Location edited successfully', 'my-calendar' ), true, false, 'success' );
}
$cur_loc = (int) $_POST['location_id'];
mc_show_location_form( 'edit', $cur_loc );
Expand Down
20 changes: 10 additions & 10 deletions my-calendar-settings.php.html
Original file line number Diff line number Diff line change
Expand Up @@ -618,11 +618,11 @@
if ( isset( $post['mc_manage'] ) ) {
$before_permalinks = mc_get_option( 'use_permalinks' );
mc_update_management_settings( $post );
mc_show_notice( __( 'My Calendar Management Settings saved', 'my-calendar' ) );
mc_show_notice( __( 'My Calendar Management Settings saved', 'my-calendar' ), true, false, 'success' );
}
if ( isset( $post['mc_permissions'] ) ) {
mc_update_permissions_settings( $post );
mc_show_notice( __( 'My Calendar Permissions Updated', 'my-calendar' ) );
mc_show_notice( __( 'My Calendar Permissions Updated', 'my-calendar' ), true, false, 'success' );
}
// Output.
if ( isset( $post['mc_show_months'] ) ) {
Expand All @@ -631,32 +631,32 @@
$post['mc_title_template_list'] = wp_kses_post( $_POST['mc_title_template_list'] );
$post['mc_title_template_solo'] = wp_kses_post( $_POST['mc_title_template_solo'] );
mc_update_output_settings( $post );
mc_show_notice( __( 'Display Settings saved', 'my-calendar' ) );
mc_show_notice( __( 'Display Settings saved', 'my-calendar' ), true, false, 'success' );
}
// Input.
if ( isset( $post['mc_input'] ) ) {
mc_update_input_settings( $post );
mc_show_notice( __( 'Input Settings saved', 'my-calendar' ) );
mc_show_notice( __( 'Input Settings saved', 'my-calendar' ), true, false, 'success' );
}
if ( current_user_can( 'manage_network' ) &amp;&amp; is_multisite() ) {
if ( isset( $post['mc_network'] ) ) {
$mc_multisite = (int) $post['mc_multisite'];
update_site_option( 'mc_multisite', $mc_multisite );
$mc_multisite_show = (int) $post['mc_multisite_show'];
update_site_option( 'mc_multisite_show', $mc_multisite_show );
mc_show_notice( __( 'Multisite settings saved', 'my-calendar' ) );
mc_show_notice( __( 'Multisite settings saved', 'my-calendar' ), true, false, 'success' );
}
}
// custom text.
if ( isset( $post['mc_previous_events'] ) ) {
mc_update_text_settings( $post );
mc_show_notice( __( 'Custom text settings saved', 'my-calendar' ) );
mc_show_notice( __( 'Custom text settings saved', 'my-calendar' ), true, false, 'success' );
}

// Save email settings.
if ( isset( $post['mc_email'] ) ) {
mc_update_email_settings( $post );
mc_show_notice( __( 'Email notice settings saved', 'my-calendar' ) );
mc_show_notice( __( 'Email notice settings saved', 'my-calendar' ), true, false, 'success' );
}

/**
Expand All @@ -665,16 +665,16 @@
* @hook mc_save_settings
*
* @param {string} Message after updating settings sent to `mc_show_notice()`.
* @param {array} $post POST global.
* @param {array} $post Sanitized POST global.
*/
$settings = do_action( 'mc_save_settings', '', $post );
if ( is_string( $settings ) &amp;&amp; '' !== $settings ) {
mc_show_notice( $settings );
mc_show_notice( $settings, true, false, 'success' );
}

$return = mc_import_settings();
if ( $return ) {
mc_show_notice( $return );
mc_show_notice( $return, true, false, 'success' );
}
}

Expand Down

0 comments on commit 88dded4

Please sign in to comment.