ID; $ignored_notice = get_user_meta( $user_id, 'ample_ignore_new_theme_notice' ); if ( ! empty( $ignored_notice ) ) { return; } $dismiss_button = sprintf( '', '?nag_ignore_new_theme=0' ); $message = sprintf( /* translators: %1$s Zakra theme link %2$s Zakra theme demo link */ esc_html__( 'Zakra - our new most flexible free WordPress theme. %1$s Zakra is fully compatible with Gutenberg, Elementor and other major page builders. Comes with %2$s to quickly setup your new website.', 'ample' ), sprintf( '%2$s', esc_url( admin_url( 'theme-install.php?theme=zakra' ) ), esc_html__( 'Check it out!', 'ample' ) ), sprintf( '%2$s', esc_url( 'https://demo.themegrill.com/zakra-demos/?utm_source=ample-dashboard&utm_medium=notice-link&utm_campaign=zakra-demo' ), esc_html__( '10+ free starter sites', 'ample' ) ) ); printf( '
%1$s

%2$s

', $dismiss_button, $message ); } /** * Update the ample_ignore_new_theme_notice option to true, to dismiss the notice from the dashboard */ public function ample_ignore_new_theme_notice() { 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_ignore_new_theme'] ) && '0' == $_GET['nag_ignore_new_theme'] ) { add_user_meta( $user_id, 'ample_ignore_new_theme_notice', 'true', true ); } } } new Ample_New_Theme_Notice();