LLMS_Abstract_Integration::get_settings()

Retrieve an array of integration related settings


Return Return

(array)


Top ↑

Source Source

File: includes/abstracts/llms.abstract.integration.php

	protected function get_settings() {

		$settings   = array();
		$settings[] = array(
			'type' => 'sectionstart',
			'id'   => 'llms_integration_' . $this->id . '_start',
		);
		$settings[] = array(
			'desc'  => $this->description,
			'id'    => 'llms_integration_' . $this->id . '_title',
			'title' => $this->title,
			'type'  => 'title',
		);
		$settings[] = array(
			'desc'    => __( 'Check to enable this integration.', 'lifterlms' ),
			'default' => 'no',
			'id'      => $this->get_option_name( 'enabled' ),
			'type'    => 'checkbox',
			'title'   => __( 'Enable / Disable', 'lifterlms' ),
		);

		if ( ! $this->is_installed() && ! empty( $this->description_missing ) ) {
			$settings[] = array(
				'id'    => 'llms_integration_' . $this->id . '_missing_requirements_desc',
				'type'  => 'custom-html',
				'value' => '<em>' . $this->description_missing . '</em>',
			);
		}

		$settings   = array_merge( $settings, $this->get_integration_settings() );
		$settings[] = array(
			'type' => 'sectionend',
			'id'   => 'llms_integration_' . $this->id . '_end',
		);

		/**
		 * Filters the integration's settings
		 *
		 * The dynamic portion of this hook, `{$this->id}`, refers to the integration's ID.
		 *
		 * @since 3.8.0
		 *
		 * @param array[] $settings Array of settings arrays.
		 * @param object  $instance Class instance of the class extending the `LLMS_Abstract_Integration` abstract.
		 */
		return apply_filters( "llms_integration_{$this->id}_get_settings", $settings, $this );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.21.0 Add an 'id' to the missing description HTML setting.
3.8.0
3.21.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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