LLMS_Abstract_Notification_View::get_field_options( string $type )

Get an array of field-related options to be add to the notifications view config page on the admin panel


Parameters Parameters

$type

(string) (Required) Type of the field.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/abstracts/llms.abstract.notification.view.php

	public function get_field_options( $type ) {

		$options = array();

		if ( $this->has_field_support( $type, 'subject' ) ) {
			$options[] = array(
				'after_html' => llms_merge_code_button( '#' . $this->get_option_name( 'subject' ), false, $this->get_merge_codes() ),
				'id'         => $this->get_option_name( 'subject' ),
				'title'      => __( 'Subject', 'lifterlms' ),
				'type'       => 'text',
				'value'      => $this->get_subject( false ),
			);
		}

		if ( $this->has_field_support( $type, 'title' ) ) {
			$options[] = array(
				'after_html' => llms_merge_code_button( '#' . $this->get_option_name( 'title' ), false, $this->get_merge_codes() ),
				'id'         => $this->get_option_name( 'title' ),
				'title'      => ( 'email' === $type ) ? __( 'Heading', 'lifterlms' ) : __( 'Title', 'lifterlms' ),
				'type'       => 'text',
				'value'      => $this->get_title( false ),
			);
		}

		if ( $this->has_field_support( $type, 'body' ) ) {
			$options[] = array(
				'editor_settings' => array(
					'teeny' => true,
				),
				'id'              => $this->get_option_name( 'body' ),
				'title'           => __( 'Body', 'lifterlms' ),
				'type'            => 'wpeditor',
				'value'           => $this->get_body( false ),
			);
		}

		if ( $this->has_field_support( $type, 'icon' ) ) {
			$options[] = array(
				'id'         => $this->get_option_name( 'icon' ),
				'image_size' => 'llms_notification_icon',
				'title'      => __( 'Icon', 'lifterlms' ),
				'type'       => 'image',
				'value'      => $this->get_icon(),
			);
			$options[] = array(
				'default'     => 'no',
				'description' => __( 'When checked the icon will not be displayed when showing this notification.', 'lifterlms' ),
				'id'          => $this->get_option_name( 'icon_hide' ),
				'title'       => __( 'Disable Icon', 'lifterlms' ),
				'type'        => 'checkbox',
			);
		}

		return apply_filters( $this->get_filter( 'get_field_options' ), $options, $this );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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