LLMS_Notifications::load_view( string $trigger, string $path = null, string $prefix = null )

Validate trigger and load its view.

Parameters Parameters


(string) (Required) Trigger id (eg: lesson_complete).


(string) (Optional) Full path to the view file, allows third parties to load external views.

Default value: null


(string) (Optional) Classname prefix. Defaults to "LLMS". Can be used by 3rd parties to adjust the prefix in accordance with the projects standards.

Default value: null

Top ↑

Return Return

(boolean) true if the view is added and loaded, false otherwise.

Top ↑

Source Source

File: includes/notifications/class.llms.notifications.php

	 * @return boolean `true` if the view is added and loaded, `false` otherwise.
	public function load_view( $trigger, $path = null, $prefix = null ) {

		// Default path for core views.
		if ( ! $path ) {
			$path = $this->get_directory() . 'views/class.llms.notification.view.' . $this->name_to_file( $trigger ) . '.php';

		if ( file_exists( $path ) ) {

			if ( ! is_null( $prefix ) ) {
				require_once $path;
			$this->views[ $this->get_view_classname( $trigger, $prefix ) ] = $trigger;
			return true;

Top ↑

Changelog Changelog

Version Description
6.0.0 Removed loading of class files that don't instantiate their class in favor of autoloading.
3.24.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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