Skip to content

Commit

Permalink
Merge pull request #221 from wordpress-parsi/5.1.2
Browse files Browse the repository at this point in the history
Fix some reported bugs
  • Loading branch information
hamidrezayazdani authored Nov 19, 2024
2 parents 2c883ce + 5f6f0dd commit 27d87ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions includes/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ function wpp_login_headerurl() {
function wpp_activation_notice() {
$dismissed = get_option( 'wpp_dismissed', false );

if ( ! $dismissed && ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'wp-parsi-settings' ) ) {
if ( ! $dismissed && ( ! isset( $_GET['page'] ) || 'wp-parsi-settings' !== $_GET['page'] ) ) {
if ( ! wpp_is_active( 'persian_date' ) ) {
$dismiss_url = wp_nonce_url( add_query_arg( 'wpp-action', 'dismiss-notice' ), 'wpp_dismiss_notice' );

echo sprintf(
__( '<div class="updated wpp-message"><p>ParsiDate activated, you may need to configure it to work properly. <a href="%s">Go to configuration page</a> &ndash; <a href="%s">Dismiss</a></p></div>', 'wp-parsidate' ),
admin_url( 'admin.php?page=wp-parsi-settings' ),
add_query_arg( 'wpp-action', 'dismiss-notice' )
esc_url( admin_url( 'admin.php?page=wp-parsi-settings' ) ),
esc_url( $dismiss_url ),
);
}
}
Expand All @@ -89,6 +91,7 @@ function wpp_activation_notice() {
*/
function wpp_dismiss_notice_action() {
if ( isset( $_GET['wpp-action'] ) && $_GET['wpp-action'] == 'dismiss-notice' ) {
check_admin_referer( 'wpp_dismiss_notice' );
update_option( 'wpp_dismissed', true );
}
}
Expand Down

0 comments on commit 27d87ba

Please sign in to comment.