Commit a340b613 authored by KR Moorhouse's avatar KR Moorhouse

Updated notices to allow for non-dismissible notices. Added link to our batch...

Updated notices to allow for non-dismissible notices. Added link to our batch processor from the admin notice.
parent ac0cd4f4
......@@ -115,6 +115,7 @@ class NF_Admin_Notices
$admin_display_msg = ( isset( $admin_notices[ $slug ][ 'msg' ] ) ? $admin_notices[ $slug ][ 'msg'] : '' );
$admin_display_title = ( isset( $admin_notices[ $slug ][ 'title' ] ) ? $admin_notices[ $slug ][ 'title'] : '' );
$admin_display_link = ( isset( $admin_notices[ $slug ][ 'link' ] ) ? $admin_notices[ $slug ][ 'link' ] : '' );
$admin_can_dismiss = ( isset( $admin_notices[ $slug ][ 'dismiss' ] ) ? $admin_notices[ $slug ][ 'dismiss' ] : 1 );
$output_css = false;
// Ensure the notice hasn't been hidden and that the current date is after the start date
......@@ -135,7 +136,9 @@ class NF_Admin_Notices
echo '<ul class="nf-notice-body nf-red">
' . $admin_display_link . '
</ul>';
echo '<a href="' . wp_nonce_url( esc_attr( $query_str ) ) . '" class="dashicons dashicons-dismiss"></a>';
if ( $admin_can_dismiss ) {
echo '<a href="' . wp_nonce_url( esc_attr( $query_str ) ) . '" class="dashicons dashicons-dismiss"></a>';
}
echo '</div>';
$this->notice_spam += 1;
......
......@@ -849,9 +849,10 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
public function data_cleanup_notice( $notices ) {
$notices[ 'data_cleanup' ] = array(
'title' => __( 'Data Cleanup', 'ninja-forms' ),
'msg' => sprintf( __( 'Ninja Forms has detected data on your site leftover from old forms or Ninja Forms versions.%sWe would like to run a quick cleanup process to remove this old data. Your forms will not be impacted by this process, but it may take several minutes to complete.%sPlease %sclick here%s to begin.', 'ninja-forms' ), '<br />', '<br /><br />', '<a href="#">', '</a>' ),
'msg' => sprintf( __( 'Ninja Forms has detected data on your site leftover from old forms or Ninja Forms versions.%sWe would like to run a quick cleanup process to remove this old data. Your forms will not be impacted by this process, but it may take several minutes to complete.%sPlease %sclick here%s to begin.', 'ninja-forms' ), '<br />', '<br /><br />', '<a href="' . admin_url( 'admin.php?page=ninja-forms&action=cleanup' ) . '">', '</a>' ),
'int' => 0,
'ignore_spam' => true,
'dismiss' => 0
);
return $notices;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment