ID; $ignored_notice = get_user_meta( $user_id, 'morenews_ignore_theme_review_notice_v3', true ); $ignored_notice_partially = get_user_meta( $user_id, 'nag_morenews_ignore_theme_review_notice_partially_v3', true ); // Return from notice display if conditions are met. if ( ( get_option( 'morenews_theme_installed_time_v3' ) > strtotime( '-5 days' ) ) || ( $ignored_notice_partially > strtotime( '-2 days' ) ) || ( $ignored_notice ) ) { return; } // Get the active theme info. $current_theme = wp_get_theme(); $theme_name = $current_theme->get( 'Name' ); $theme_slug = $current_theme->get_stylesheet(); $review_link = 'https://wordpress.org/support/theme/' . strtolower( $theme_slug ) . '/reviews/?filter=5#new-post'; ?>
ID; /* If user clicks to ignore the notice, add that to their user meta */ if ( isset( $_GET['nag_morenews_ignore_theme_review_notice_v3'] ) && '0' == $_GET['nag_morenews_ignore_theme_review_notice_v3'] ) { add_user_meta( $user_id, 'morenews_ignore_theme_review_notice_v3', 'true', true ); } } /** * Function to remove the theme review notice partially as requested by the user. */ public function morenews_ignore_theme_review_notice_partially() { global $current_user; $user_id = $current_user->ID; /* If user clicks to ignore the notice temporarily, update the timestamp */ if ( isset( $_GET['nag_morenews_ignore_theme_review_notice_partially_v3'] ) && '0' == $_GET['nag_morenews_ignore_theme_review_notice_partially_v3'] ) { update_user_meta( $user_id, 'nag_morenews_ignore_theme_review_notice_partially_v3', time() ); } } /** * Remove the data set after the theme has been switched to other theme. */ public function morenews_theme_rating_notice_data_remove() { $get_all_users = get_users(); $theme_installed_time = get_option( 'morenews_theme_installed_time_v3' ); // Delete options data. if ( $theme_installed_time ) { delete_option( 'morenews_theme_installed_time_v3' ); } // Delete user meta data for theme review notice. foreach ( $get_all_users as $user ) { $ignored_notice = get_user_meta( $user->ID, 'morenews_ignore_theme_review_notice_v3', true ); $ignored_notice_partially = get_user_meta( $user->ID, 'nag_morenews_ignore_theme_review_notice_partially_v3', true ); // Delete permanent notice remove data. if ( $ignored_notice ) { delete_user_meta( $user->ID, 'morenews_ignore_theme_review_notice_v3' ); } // Delete partial notice remove data. if ( $ignored_notice_partially ) { delete_user_meta( $user->ID, 'nag_morenews_ignore_theme_review_notice_partially_v3' ); } } } } new MoreNews_Theme_Review_Notice();