LLMS_Admin_Notices::output_global_notices()


Source Source

File: includes/admin/class.llms.admin.notices.php

	public static function output_global_notices() {

		if ( ! current_user_can( 'manage_options' ) ) {
			return;
		}
		global $lifterlms_banner_notifications;

		// Default to showing notification banners.
		$show_notifications = true;

		// Hide notifications if the user has disabled them.
		if ( $lifterlms_banner_notifications->get_max_notification_priority() < 1 ) {
			$show_notifications = false;
		}

		if ( $show_notifications ) :
			?>
			<div id="lifterlms-notifications" style="position:relative;">
			</div>
			<?php
			// To debug a specific notification.
			if ( ! empty( $_REQUEST['lifterlms_notification'] ) ) {
				$specific_notification = '&lifterlms_notification=' . intval( $_REQUEST['lifterlms_notification'] );
			} else {
				$specific_notification = '';
			}
			?>
			<script>
				jQuery(document).ready( function() {
					jQuery.get('<?php echo esc_url_raw( admin_url( 'admin-ajax.php?action=lifterlms_notifications' . $specific_notification ) ); ?>', function(data) {
						if ( data && data != 'NULL' )
							jQuery( '#lifterlms-notifications' ).html( data );
					});
				});
			</script>
			<?php
		endif;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.