\MLASettings

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

Summary

Methods
Properties
Constants
initialize()
mla_activation_hook()
mla_deactivation_hook()
mla_admin_init_action()
mla_admin_enqueue_scripts_action()
mla_admin_menu_action()
mla_add_menu_options_action()
mla_add_help_tab_action()
mla_screen_options_show_screen_filter()
mla_set_screen_option_filter()
mla_inline_edit_view_action()
mla_inline_edit_upload_action()
mla_inline_mapping_custom_action()
mla_inline_mapping_iptc_exif_action()
mla_add_plugin_settings_link_filter()
mla_update_option_row()
mla_compose_option_row()
mla_localize_tablist()
mla_get_icon_type_dropdown()
mla_render_settings_page()
$page_template_array
JAVASCRIPT_INLINE_EDIT_VIEW_SLUG
JAVASCRIPT_INLINE_EDIT_VIEW_OBJECT
JAVASCRIPT_INLINE_EDIT_UPLOAD_SLUG
JAVASCRIPT_INLINE_EDIT_UPLOAD_OBJECT
JAVASCRIPT_INLINE_MAPPING_CUSTOM_SLUG
JAVASCRIPT_INLINE_MAPPING_IPTC_EXIF_SLUG
JAVASCRIPT_INLINE_MAPPING_OBJECT
No protected methods found
No protected properties found
N/A
_version_upgrade()
mla_get_options_tablist()
_compose_settings_tabs()
_compose_general_tab()
_current_bulk_action()
_compose_edit_view_tab()
_compose_view_tab()
_compose_edit_upload_tab()
_compose_optional_upload_tab()
_process_optional_upload_mime()
_compose_upload_tab()
_compose_mla_gallery_tab()
_compose_custom_field_tab()
_compose_iptc_exif_tab()
_compose_example_tab()
_compose_documentation_tab()
_save_debug_settings()
_compose_settings_row()
_compose_debug_tab()
_save_gallery_settings()
_save_view_settings()
_save_upload_settings()
_process_custom_field_mapping()
_delete_custom_field()
_save_custom_field_settings()
_process_iptc_exif_standard()
_process_iptc_exif_taxonomy()
_process_iptc_exif_custom()
_save_iptc_exif_custom_settings()
_save_iptc_exif_settings()
_save_general_settings()
_reset_general_settings()
_compose_import_settings()
_export_settings()
_import_settings()
$current_page_hook
$mla_tablist
N/A

Constants

JAVASCRIPT_INLINE_EDIT_VIEW_SLUG

JAVASCRIPT_INLINE_EDIT_VIEW_SLUG

Slug for localizing and enqueueing JavaScript - MLA View List Table

JAVASCRIPT_INLINE_EDIT_VIEW_OBJECT

JAVASCRIPT_INLINE_EDIT_VIEW_OBJECT

Object name for localizing JavaScript - MLA View List Table

JAVASCRIPT_INLINE_EDIT_UPLOAD_SLUG

JAVASCRIPT_INLINE_EDIT_UPLOAD_SLUG

Slug for localizing and enqueueing JavaScript - MLA Upload List Table

JAVASCRIPT_INLINE_EDIT_UPLOAD_OBJECT

JAVASCRIPT_INLINE_EDIT_UPLOAD_OBJECT

Object name for localizing JavaScript - MLA Upload List Table

JAVASCRIPT_INLINE_MAPPING_CUSTOM_SLUG

JAVASCRIPT_INLINE_MAPPING_CUSTOM_SLUG

Slug for localizing and enqueueing JavaScript - MLA Custom tab

JAVASCRIPT_INLINE_MAPPING_IPTC_EXIF_SLUG

JAVASCRIPT_INLINE_MAPPING_IPTC_EXIF_SLUG

Slug for localizing and enqueueing JavaScript - MLA IPTC/EXIF tab

JAVASCRIPT_INLINE_MAPPING_OBJECT

JAVASCRIPT_INLINE_MAPPING_OBJECT

Object name for localizing JavaScript - MLA Custom and IPTC/EXIF tabs

Properties

$page_template_array

$page_template_array : array

Template file for the Settings page(s) and parts

This array contains all of the template parts for the Settings page(s). The array is built once each page load and cached for subsequent use.

Type

array

$current_page_hook

$current_page_hook : array

Holds screen id to match help text to corresponding screen

Type

array

$mla_tablist

$mla_tablist : array

Definitions for Settings page tab ids, titles and handlers Each tab is defined by an array with the following elements:

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

title => tab label / heading text render => rendering function for tab messages and content. Usage: $tab_content = ['render']( );

The array must be populated at runtime in MLASettings::mla_localize_tablist(); localization calls cannot be placed in the "public static" array definition itself.

Type

array

Methods

initialize()

initialize() : void

Initialization function, similar to __construct()

mla_activation_hook()

mla_activation_hook() : void

Perform one-time actions on plugin activation

mla_deactivation_hook()

mla_deactivation_hook() : void

Perform one-time actions on plugin deactivation

mla_admin_init_action()

mla_admin_init_action() : void

Load the plugin's Ajax handler

mla_admin_enqueue_scripts_action()

mla_admin_enqueue_scripts_action(  $page_hook) : void

Load the plugin's Style Sheet and Javascript files

Parameters

$page_hook

mla_admin_menu_action()

mla_admin_menu_action() : void

Add settings page in the "Settings" section, add screen options and help tabs, add settings link in the Plugins section entry for MLA.

mla_add_menu_options_action()

mla_add_menu_options_action() : void

Add the "XX Entries per page" filter to the Screen Options tab

mla_add_help_tab_action()

mla_add_help_tab_action() : void

Add contextual help tabs to all the MLA pages

mla_screen_options_show_screen_filter()

mla_screen_options_show_screen_filter(  $show_screen,   $this_screen) : boolean

Only show screen options on the View and Upload tabs

Parameters

$show_screen
$this_screen

Returns

boolean —

True to display "Screen Options", false to suppress them

mla_set_screen_option_filter()

mla_set_screen_option_filter(  $status,   $option,   $value) : string|void

Save the "Views/Uploads per page" option set by this user

Parameters

$status
$option
$value

Returns

string|void —

New value if this is our option, otherwise nothing

mla_inline_edit_view_action()

mla_inline_edit_view_action() : void

Ajax handler for Post MIME Types inline editing (quick and bulk edit)

Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php

mla_inline_edit_upload_action()

mla_inline_edit_upload_action() : void

Ajax handler for Upload MIME Types inline editing (quick and bulk edit)

Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php

mla_inline_mapping_custom_action()

mla_inline_mapping_custom_action() : void

Ajax handler for Custom Fields tab inline mapping

mla_inline_mapping_iptc_exif_action()

mla_inline_mapping_iptc_exif_action() : void

Ajax handler for IPTC/EXIF tab inline mapping

mla_add_plugin_settings_link_filter()

mla_add_plugin_settings_link_filter(  $links,   $file) : array

Add the "Settings" link to the MLA entry in the Plugins section

Parameters

$links
$file

Returns

array —

Updated array of links for the Plugin

mla_update_option_row()

mla_update_option_row(  $key,   $value,   $option_table = NULL) : string

Update or delete a single MLA option value

Parameters

$key
$value
$option_table

Returns

string —

HTML markup for the option's table row

mla_compose_option_row()

mla_compose_option_row(  $key,   $value,   $option_table = NULL) : string

Compose the table row for a single MLA option

Parameters

$key
$value
$option_table

Returns

string —

HTML markup for the option's table row

mla_localize_tablist()

mla_localize_tablist() : void

Localize $mla_tablist array

Localization must be done at runtime; these calls cannot be placed in the "public static" array definition itself. Called from MLATest::initialize.

mla_get_icon_type_dropdown()

mla_get_icon_type_dropdown(  $templates,   $name,   $selection = '.none.') : string

Get an HTML select element representing a list of icon types

Parameters

$templates
$name
$selection

Returns

string —

HTML select element or empty string on failure.

mla_render_settings_page()

mla_render_settings_page() : void

Render (echo) the "Media Library Assistant" subpage in the Settings section

_version_upgrade()

_version_upgrade() : void

Database and option update check, for installing new versions

mla_get_options_tablist()

mla_get_options_tablist(  $tab = NULL) : array|false

Retrieve the list of options tabs or a specific tab value

Parameters

$tab

Returns

array|false —

The entire tablist ( $tab = NULL ), a single tab entry or false if not found/not allowed

_compose_settings_tabs()

_compose_settings_tabs(  $active_tab = 'general') : string

Compose the navigation tabs for the Settings subpage

Parameters

$active_tab

Returns

string —

HTML markup for the Settings subpage navigation tabs

_compose_general_tab()

_compose_general_tab() : array

Compose the General tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_current_bulk_action()

_current_bulk_action() : string|false

Get the current action selected from the bulk actions dropdown

Returns

string|false —

The action name or False if no action was selected

_compose_edit_view_tab()

_compose_edit_view_tab(  $view,   $template) : array

Compose the Edit View tab content for the Settings subpage

Parameters

$view
$template

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_view_tab()

_compose_view_tab() : array

Compose the Post MIME Type Views tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_edit_upload_tab()

_compose_edit_upload_tab(  $item,   $templates) : array

Compose the Edit Upload type tab content for the Settings subpage

Parameters

$item
$templates

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_optional_upload_tab()

_compose_optional_upload_tab(  $page_template_array) : array

Compose the Optional File Upload MIME Types tab content for the Settings subpage

Parameters

$page_template_array

Returns

array —

'message' => status/error messages, 'body' => tab content

_process_optional_upload_mime()

_process_optional_upload_mime(  $ID) : array

Process an Optional Upload MIME Type selection

Parameters

$ID

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_upload_tab()

_compose_upload_tab() : array

Compose the File Upload MIME Types tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_mla_gallery_tab()

_compose_mla_gallery_tab() : array

Compose the MLA Gallery tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_custom_field_tab()

_compose_custom_field_tab() : array

Compose the Custom Field tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_iptc_exif_tab()

_compose_iptc_exif_tab() : array

Compose the IPTC/EXIF tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_example_tab()

_compose_example_tab() : array

Compose the Example Plugin tab content for the Settings/Documentation subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_compose_documentation_tab()

_compose_documentation_tab() : array

Compose the Documentation tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_save_debug_settings()

_save_debug_settings() : array

Save Debug settings to the options table

Returns

array —

Message(s) reflecting the results of the operation

_compose_settings_row()

_compose_settings_row(string  $label, string  $value) : string

Compose the Debug tab Debug Settings content for one setting

Parameters

string $label

Display name for the setting

string $value

Current value for the setting

Returns

string —

HTML table row markup for the label setting pair

_compose_debug_tab()

_compose_debug_tab() : array

Compose the Debug tab content for the Settings subpage

Returns

array —

'message' => status/error messages, 'body' => tab content

_save_gallery_settings()

_save_gallery_settings() : array

Save MLA Gallery settings to the options table

Returns

array —

Message(s) reflecting the results of the operation

_save_view_settings()

_save_view_settings() : array

Save View settings to the options table

Returns

array —

Message(s) reflecting the results of the operation

_save_upload_settings()

_save_upload_settings() : array

Save Upload settings to the options table

Returns

array —

Message(s) reflecting the results of the operation

_process_custom_field_mapping()

_process_custom_field_mapping(  $settings = NULL,   $offset,   $length) : array

Process custom field settings against all image attachments without saving the settings to the mla_option

Parameters

$settings
$offset
$length

Returns

array —

Message(s) reflecting the results of the operation

_delete_custom_field()

_delete_custom_field(  $value) : array

Delete a custom field from the wp_postmeta table

Parameters

$value

Returns

array —

Message(s) reflecting the results of the operation

_save_custom_field_settings()

_save_custom_field_settings(  $new_values = NULL) : array

Save custom field settings to the options table

Parameters

$new_values

Returns

array —

Message(s) reflecting the results of the operation

_process_iptc_exif_standard()

_process_iptc_exif_standard(  $offset,   $length) : array

Process IPTC/EXIF standard field settings against all image attachments without saving the settings to the mla_option

Parameters

$offset
$length

Returns

array —

Message(s) reflecting the results of the operation

_process_iptc_exif_taxonomy()

_process_iptc_exif_taxonomy(  $offset,   $length) : array

Process IPTC/EXIF taxonomy term settings against all image attachments without saving the settings to the mla_option

Parameters

$offset
$length

Returns

array —

Message(s) reflecting the results of the operation

_process_iptc_exif_custom()

_process_iptc_exif_custom(  $settings = NULL,   $offset,   $length) : array

Process IPTC/EXIF custom field settings against all image attachments without saving the settings to the mla_option

Parameters

$settings
$offset
$length

Returns

array —

Message(s) reflecting the results of the operation

_save_iptc_exif_custom_settings()

_save_iptc_exif_custom_settings(  $new_values) : array

Save IPTC/EXIF custom field settings to the options table

Parameters

$new_values

Returns

array —

Message(s) reflecting the results of the operation

_save_iptc_exif_settings()

_save_iptc_exif_settings() : array

Save IPTC/EXIF settings to the options table

Returns

array —

Message(s) reflecting the results of the operation

_save_general_settings()

_save_general_settings() : array

Save General settings to the options table

Returns

array —

Message(s) reflecting the results of the operation

_reset_general_settings()

_reset_general_settings() : array

Delete saved settings, restoring default values

Returns

array —

Message(s) reflecting the results of the operation

_compose_import_settings()

_compose_import_settings() : string

Compose HTML markup for the import settings if any settings files exist

Returns

string —

HTML markup for the Import All Settings button and dropdown list, if any

_export_settings()

_export_settings() : array

Serialize option settings and write them to a file

Options with a default value, i.e., not stored in the database are NOT written to the file.

Returns

array —

Message(s) reflecting the results of the operation

_import_settings()

_import_settings() : array

Read a serialized file of option settings and write them to the database

Returns

array —

Message(s) reflecting the results of the operation