ID; $current_user = wp_get_current_user(); $ignored_notice = get_user_meta( $user_id, 'zakra_ignore_theme_review_notice', true ); $ignored_notice_partially = get_user_meta( $user_id, 'nag_zakra_ignore_theme_review_notice_partially', true ); /** * Return from notice display if: * * 1. The theme installed is less than 15 days ago. * 2. If the user has ignored the message partially for 15 days. * 3. Dismiss always if clicked on 'I Already Did' button. */ if ( ( get_option( 'zakra_theme_installed_time' ) > strtotime( '-15 day' ) ) || ( $ignored_notice_partially > strtotime( '-15 day' ) ) || ( $ignored_notice ) ) { return; } ?>

' . esc_html( $current_user->display_name ) . '' ); ?>

ID; /* If user clicks to ignore the notice, add that to their user meta */ if ( isset( $_GET['nag_zakra_ignore_theme_review_notice'] ) && '0' == $_GET['nag_zakra_ignore_theme_review_notice'] ) { add_user_meta( $user_id, 'zakra_ignore_theme_review_notice', 'true', true ); } } /** * Function to remove the theme review notice partially as requested by the user. */ public function zakra_ignore_theme_review_notice_partially() { global $current_user; $user_id = $current_user->ID; /* If user clicks to ignore the notice, add that to their user meta */ if ( isset( $_GET['nag_zakra_ignore_theme_review_notice_partially'] ) && '0' == $_GET['nag_zakra_ignore_theme_review_notice_partially'] ) { update_user_meta( $user_id, 'nag_zakra_ignore_theme_review_notice_partially', time() ); } } /** * Remove the data set after the theme has been switched to other theme. */ public function zakra_theme_rating_notice_data_remove() { global $current_user; $user_id = $current_user->ID; $theme_installed_time = get_option( 'zakra_theme_installed_time' ); $ignored_notice = get_user_meta( $user_id, 'zakra_ignore_theme_review_notice', true ); $ignored_notice_partially = get_user_meta( $user_id, 'nag_zakra_ignore_theme_review_notice_partially', true ); // Delete options data. if ( $theme_installed_time ) { delete_option( 'zakra_theme_installed_time' ); } // Delete permanent notice remove data. if ( $ignored_notice ) { delete_user_meta( $user_id, 'zakra_ignore_theme_review_notice' ); } // Delete partial notice remove data. if ( $ignored_notice_partially ) { delete_user_meta( $user_id, 'nag_zakra_ignore_theme_review_notice_partially' ); } } /** * Enqueue the required CSS file for theme review notice on admin page. */ public function zakra_theme_review_notice_enqueue() { wp_enqueue_style( 'zakra-theme-review-notice', ZAKRA_PARENT_INC_URI . '/admin/css/theme-review-notice.css' ); } } new Zakra_Theme_Review_Notice();