Properties

$settings_map

$settings_map : array

Type

normal

$settings_structure

$settings_structure : array

Type

normal

$previous_licenses

$previous_licenses

$need_change_permalinks

$need_change_permalinks

$gravatar_changed

$gravatar_changed

Methods

__construct()

__construct() : mixed

Admin_Settings constructor.

Returns

mixed

same_page_update_ajax()

same_page_update_ajax() : mixed

Returns

mixed

init_variables()

init_variables() : mixed

Returns

mixed

sorting_licenses_options()

sorting_licenses_options(array  $settings) : array

Parameters

array $settings

Returns

array

get_section_fields()

get_section_fields( $tab,  $section) : array

Parameters

$tab
$section

Returns

array

settings_page()

settings_page() : mixed

Settings page callback.

Returns

mixed

get_api_key_field_ids()

get_api_key_field_ids() : mixed

Collect the ids of all `api_key` settings fields, mapped to the tab/section they live in.

The field type is only present in the settings structure (not in the settings map), so we walk the structure tree ([tab]['sections']section['fields'][]). The tab/section is captured so the migration notice can deep-link to the right settings page.

Returns

mixed

save_api_key_constants()

save_api_key_constants(array  $settings) : array

Divert `api_key` field values to wp-config.php constants on settings save.

For every submitted api_key field: write (or update) its value as a UM_OPTION_<ID> constant, or remove that constant when the value is empty; then strip the value from the settings array and delete any legacy DB copy so the secret is never persisted to um_options. Write failures are collected into a transient consumed by the admin notice.

Hooked on um_change_settings_before_save (priority 8, before sanitize/DB write).

Parameters

array $settings

Settings about to be saved.

Returns

array

save_settings_handler()

save_settings_handler() : mixed

Handler for settings forms when "Save Settings" button click

Returns

mixed

set_default_if_empty()

set_default_if_empty(mixed  $settings) : mixed

Parameters

mixed $settings

Returns

mixed

remove_empty_values()

remove_empty_values(array  $settings) : array

Remove empty values from multi text fields.

Parameters

array $settings

Returns

array

check_permalinks_changes()

check_permalinks_changes() : mixed

Returns

mixed

on_settings_save()

on_settings_save() : mixed

Returns

mixed

before_licenses_save()

before_licenses_save() : mixed

Returns

mixed

licenses_save()

licenses_save() : mixed

Returns

mixed

settings_before_email_tab()

settings_before_email_tab() : mixed

Adds email notifications list table before the email options list.

Returns

mixed

email_section_custom_fields()

email_section_custom_fields(bool|array  $section_fields, string  $tab) : bool|array

Set settings field per email notification.

Parameters

bool|array $section_fields
string $tab

Returns

bool|array

settings_licenses_tab()

settings_licenses_tab(bool  $html, string  $current_tab, string  $current_subtab) : bool|string

Parameters

bool $html
string $current_tab
string $current_subtab

Returns

bool|string

settings_override_templates_tab()

settings_override_templates_tab() : string

HTML for Settings > Advanced > Override Templates tab.

Returns

string

scan_template_files()

scan_template_files(string  $template_path) : array

Scan the template files.

Parameters

string $template_path

Path to the template directory.

Returns

array

render_settings_section()

render_settings_section(array  $section_fields, string  $current_tab, string  $current_subtab) : string

Render settings section.

Parameters

array $section_fields
string $current_tab
string $current_subtab

Returns

string

save_email_templates()

save_email_templates(array  $settings) : array

Parameters

array $settings

Returns

array

generate_tabs_menu()

generate_tabs_menu(string  $page = 'settings') : string

Generate pages tabs.

Parameters

string $page

Returns

string

generate_subtabs_menu()

generate_subtabs_menu(string  $tab = '') : string

Parameters

string $tab

Returns

string

collect_api_key_fields()

collect_api_key_fields(array  $fields, string  $tab_key, string  $section_key, array  $result) : mixed

Push `api_key` fields from a fields list into the result set.

Parameters

array $fields

List of field arrays.

string $tab_key

Tab slug.

string $section_key

Section slug.

array $result

Accumulator, passed by reference.

Returns

mixed

is_license_debug_enabled()

is_license_debug_enabled() : bool

Check if license debug is enabled based on defined constants.

Returns

bool