LLMS_Admin_Settings::get_option( string $option_name, mixed $default = '' )

Get a setting from the settings API.


Parameters Parameters

$option_name

(string) (Required) Option name.

$default

(mixed) (Optional) default value.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/admin/class.llms.admin.settings.php

		// Array value.
		if ( strstr( $option_name, '[' ) ) {

			parse_str( $option_name, $option_array );

			// Option name is first key.
			$option_name = current( array_keys( $option_array ) );

			// Get value.
			$option_values = get_option( $option_name, '' );

			$key = key( $option_array[ $option_name ] );

			if ( isset( $option_values[ $key ] ) ) {
				$option_value = $option_values[ $key ];
			} else {
				$option_value = null;
			}
		} else {
			$option_value = get_option( $option_name, null );
		}

		if ( is_array( $option_value ) ) {
			$option_value = array_map( 'stripslashes', $option_value );
		} elseif ( ! is_null( $option_value ) ) {
			$option_value = stripslashes( $option_value );
		}

		return null === $option_value ? $default : $option_value;

	}



Top ↑

Changelog Changelog

Changelog
Version Description
3.7.5 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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