Class MLA (Media Library Assistant) Settings manages the plugin option settings and provides the settings page to edit them.

package Media Library Assistant
since 0.1

 Methods

Initialization function, similar to __construct()

initialize() 

since 0.1

Add settings page in the "Settings" section, add settings link in the Plugins section entry for MLA.

mla_admin_menu_action() 

since 0.1

Delete the stored value of a defined MLA option

mla_delete_option(string $option) : boolean

since 0.1

Parameters

$option

string

Name of the desired option

Returns

booleanTrue if the option was deleted, otherwise false

Return the stored value or default value of a defined MLA option

mla_get_option(string $option) : mixed

since 0.1

Parameters

$option

string

Name of the desired option

Returns

mixedValue(s) for the option or false if the option is not a defined MLA option

Render the "Media Library Assistant" subpage in the Settings section

mla_render_settings_page() : \HTML

since 0.1

Returns

\HTMLmarkup for the settings subpage

Add or update the stored value of a defined MLA option

mla_update_option(string $option, mixed $newvalue) : boolean

since 0.1

Parameters

$option

string

Name of the desired option

$newvalue

mixed

New value for the desired option

Returns

booleanTrue if the value was changed or false if the update failed

Delete saved settings, restoring default values

_reset_settings(array $template_array) : array

since 0.1

Parameters

$template_array

array

HTML template(s) for the settings page

Returns

arrayMessage(s) reflecting the results of the operation.

Save settings to the options table

_save_settings(array $template_array) : array

since 0.1

Parameters

$template_array

array

HTML template(s) for the settings page

Returns

arrayMessage(s) reflecting the results of the operation.

 Properties

 

$mla_options defines the database options and admin page areas for setting/updating them.

$mla_options 

Each option is defined by an array with the following elements:

array key => HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)

name => admin page label or heading text type => 'checkbox', 'header', 'radio', 'select', 'text', 'textarea' std => default value help => help text size => text size, default 40 cols => textbox columns, default 90 rows => textbox rows, default 5 options => array of radio or select option values

 Constants

 

Provides a unique name for the settings page.

MLA_SETTINGS_SLUG