llms_maybe_hide_notifications( $priority )


Source Source

File: includes/llms-notifications.php

function llms_maybe_hide_notifications( $priority ) {
	if ( ! is_admin() ) {
		return 0;
	}

	$current_screen = get_current_screen();

	if ( ! isset( $current_screen->post_type ) ) {
		return $priority;
	}

	// Check if we're on the main WP admin dashboard.
	if ( 'dashboard' === $current_screen->id ) {
		return $priority;
	}

	if ( llms_is_block_editor() ) {
		return 0;
	}

	if (
		strpos( $current_screen->post_type, 'llms_' ) !== 0 &&
		strpos( $current_screen->base, 'lifterlms' ) !== 0 &&
		! in_array( $current_screen->post_type, array( 'course', 'lesson' ), true )
	) {
		return 0;
	}

	return $priority;
}


Top ↑

User Contributed Notes User Contributed Notes

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