'info', 'dismissible' => true, 'paragraph_wrap' => false, 'additional_classes' => array( 'begnas-welcome-notice' ), ); $message = '

' . esc_html__( 'Thanks for installing Begnas theme', 'begnas' ) . '

' . esc_html__( 'Welcome to Begnas Theme! To ensure a smooth onboarding experience, we\'ve compiled some helpful resources for you', 'begnas' ) . '

' . esc_html__( 'Read Documentation', 'begnas' ) . ' ' . esc_html__( 'Read Blog', 'begnas' ) . ' ' . esc_html__( 'Contact Support', 'begnas' ) . '
'; wp_admin_notice( $message, $args ); } add_action('admin_notices', BEGNAS_NS . 'welcome_notice'); /** * Dismiss welcome notice * * Save nag value in database when user clicks on dismiss button. * To check later the value while outputting the notice markup. * * @package begnas * @since Begnas 1.0.3 */ function update_dismiss_notice_option() { if ( isset( $_GET['begnas-hide-notice'] ) && isset( $_GET['_begnas_notice_nonce'] ) ) { // Check the nonce. if ( ! wp_verify_nonce( wp_unslash( $_GET['_begnas_notice_nonce'] ), 'begnas_hide_notices_nonce' ) ) { wp_die( __( 'Action failed. Please refresh the page and retry.', 'begnas' ) ); } if ( ! current_user_can( 'manage_options' ) ) { wp_die( __( 'Cheatin’ huh?', 'begnas' ) ); } $hide_notice = sanitize_text_field( wp_unslash( $_GET['begnas-hide-notice'] ) ); // Save the nag value if ( 'welcome' === $hide_notice ) { update_option( 'begnas_admin_notice_' . $hide_notice, 1 ); } } } add_action( 'wp_loaded', BEGNAS_NS . 'update_dismiss_notice_option', 15 );