public/wordpress/wp-content/plugins/wp-courseware/includes/functions/notices.php
/**
 * Print All Notices.
 *
 * Prints messages and errors which are
 * stored in the session, then clears them.
 *
 * @since 4.3.0
 */
Print All Notices.
Prints messages and errors which are
stored in the session, then clears them.


Print All Notices . Prints messages and errors which are stored in the session then clears them .
function wpcw_print_notices() {
	if ( ! did_action( 'wpcw_init' ) ) {
		wpcw_doing_it_wrong( __FUNCTION__, __( 'This function should not be called before wpcw_init.', 'wp-courseware' ), '4.3.0' );
		return;
	}
	$all_notices  = wpcw()->session->get( 'wpcw_notices', array() );
	$notice_types = apply_filters( 'wpcw_notice_types', array( 'error', 'success', 'info' ) );
	foreach ( $notice_types as $notice_type ) {
		if ( wpcw_notice_count( $notice_type ) > 0 ) {
			wpcw_get_template( "notices/{$notice_type}.php", array(
				'messages' => array_filter( $all_notices[ $notice_type ] ),
			) );
		}
	}
	wpcw_clear_notices();
}
function wpcw_print_notices ( ) { if ( ! did_action ( 'wpcw_init' ) ) { wpcw_doing_it_wrong ( __FUNCTION__ , __ ( 'This function should not be called before wpcw_init.' , 'wp-courseware' ) , '4.3.0' ) ; return ; } $ all_notices = wpcw ( ) -> session -> get ( 'wpcw_notices' , array ( ) ) ; $ notice_types = apply_filters ( 'wpcw_notice_types' , array ( 'error' , 'success' , 'info' ) ) ; foreach ( $ notice_types as $ notice_type ) { if ( wpcw_notice_count ( $ notice_type ) > 0 ) { wpcw_get_template ( " notices/ { $ notice_type } .php " , array ( 'messages' => array_filter ( $ all_notices [ $ notice_type ] ) , ) ) ; } } wpcw_clear_notices ( ) ; }
Print All Notices.
Print All Notices .