LLMS_Notification_Controller_Student_Welcome::get_test_settings( string $type )

Get an array of LifterLMS Admin Page settings to send test notifications


Parameters Parameters

$type

(string) (Required) Notification type [basic|email]


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/notifications/controllers/class.llms.notification.controller.student.welcome.php

	public function get_test_settings( $type ) {

		$query = new WP_User_Query(
			array(
				'number' => 25,
			)
		);

		$options = array(
			'' => '',
		);
		foreach ( $query->get_results() as $user ) {
			$student = llms_get_student( $user );
			if ( $student ) {
				$options[ $student->get_id() ] = esc_attr( sprintf( __( '%1$s <%2$s>', 'lifterlms' ), $student->get_name(), $student->get( 'user_email' ) ) );
			}
		}

		return array(
			array(
				'class'             => 'llms-select2',
				'custom_attributes' => array(
					'data-allow-clear' => true,
					'data-placeholder' => __( 'Select a user', 'lifterlms' ),
				),
				'default'           => '',
				'id'                => 'user_id',
				'desc'              => '<br/>' . __( 'Send yourself a test notification using information for the selected user.', 'lifterlms' ),
				'options'           => $options,
				'title'             => __( 'Send a Test', 'lifterlms' ),
				'type'              => 'select',
			),
		);

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.33.2 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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