Class MLA (Media Library Assistant) Settings provides the settings page to edit the plugin option settings
Methods
Initialization function, similar to __construct()
initialize() : void
Perform one-time actions on plugin activation
mla_activation_hook() : void
Adds a view to the database to support sorting the listing on 'ALT Text'.
Add contextual help tabs to all the MLA pages
mla_add_help_tab_action() : void
Add the "Settings" link to the MLA entry in the Plugins section
mla_add_plugin_settings_link_filter(array $links, string $file) : array
Parameters
$links
array
array of links for the Plugin, e.g., "Activate"
$file
string
Directory and name of the plugin Index file
Returns
array
Updated array of links for the Plugin
Load the plugin's Style Sheet and Javascript files
mla_admin_enqueue_scripts_action(string $page_hook) : void
Parameters
$page_hook
string
Name of the page being loaded
Load the plugin's Ajax handler
mla_admin_init_action() : void
Perform one-time actions on plugin deactivation
mla_deactivation_hook() : void
Removes (if present) a view from the database that supports sorting the listing on 'ALT Text'.
Get an HTML select element representing a list of icon types
mla_get_icon_type_dropdown(array $templates, string $name, string $selection) : string
Parameters
$templates
array
Display template array
$name
string
HTML name attribute value
$selection
string
currently selected Icon Type
Returns
string
HTML select element or empty string on failure.
Ajax handler for Upload MIME Types inline editing (quick and bulk edit)
mla_inline_edit_upload_action() : void
Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php
Ajax handler for Post MIME Types inline editing (quick and bulk edit)
mla_inline_edit_view_action() : void
Adapted from wp_ajax_inline_save in /wp-admin/includes/ajax-actions.php
Localize $mla_option_definitions array
mla_localize_tablist() : void
Localization must be done at runtime, and these calls cannot be placed
in the "public static" array definition itself.
Render (echo) the "Media Library Assistant" subpage in the Settings section
mla_render_settings_page() : void
Only show screen options on the View and Upload tabs
mla_screen_options_show_screen_filter(boolean $show_screen, string $this_screen) : boolean
Parameters
$show_screen
boolean
True to display "Screen Options", false to suppress them
$this_screen
string
Name of the page being loaded
Returns
boolean
True to display "Screen Options", false to suppress them
Save the "Views/Uploads per page" option set by this user
mla_set_screen_option_filter(mixed $status, string $option, string $value) : string | void
Parameters
$status
mixed
false or value returned by previous filter
$option
string
Name of the option being changed
$value
string
New value of the option
Returns
string
void
New value if this is our option, otherwise nothing
Compose the Custom Field tab content for the Settings subpage
_compose_custom_field_tab() : array
since |
1.10 |
uses |
\global\$page_template_array |
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the Documentation tab content for the Settings subpage
_compose_documentation_tab() : array
since |
0.80 |
uses |
\global\$page_template_array |
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the Edit Upload type tab content for the Settings subpage
_compose_edit_upload_tab(array $item, string $templates) : array
Parameters
$item
array
data values for the item
$templates
string
Display template array
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the Edit View tab content for the Settings subpage
_compose_edit_view_tab(array $view, string $template) : array
Parameters
$view
array
data values for the item
$template
string
Display template
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the General tab content for the Settings subpage
_compose_general_tab() : array
since |
0.80 |
uses |
\global\$page_template_array |
Returns
array
'message' => status/error messages, 'body' => tab content
Compose HTML markup for the import settings if any settings files exist
_compose_import_settings() : string
Returns
string
HTML markup for the Import All Settings button and dropdown list, if any
Compose the IPTC/EXIF tab content for the Settings subpage
_compose_iptc_exif_tab() : array
since |
1.00 |
uses |
\global\$page_template_array |
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the MLA Gallery tab content for the Settings subpage
_compose_mla_gallery_tab() : array
since |
0.80 |
uses |
\global\$page_template_array |
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the table row for a single MLA option
_compose_option_row(string $key, array $value) : string
since |
0.80 |
uses |
\global\$page_template_array |
Parameters
$key
string
HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
$value
array
Option parameters, e.g., 'type', 'std'
Returns
string
HTML markup for the option's table row
Compose the Optional File Upload MIME Types tab content for the Settings subpage
_compose_optional_upload_tab(string $page_template_array) : array
Parameters
$page_template_array
string
Display templates
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the navigation tabs for the Settings subpage
_compose_settings_tabs(string $active_tab) : string
since |
0.80 |
uses |
\global\$page_template_array |
Parameters
$active_tab
string
Optional data-tab-id value for the active tab, default 'general'
Returns
string
HTML markup for the Settings subpage navigation tabs
Compose the File Upload MIME Types tab content for the Settings subpage
_compose_upload_tab() : array
Returns
array
'message' => status/error messages, 'body' => tab content
Compose the Post MIME Type Views tab content for the Settings subpage
_compose_view_tab() : array
Returns
array
'message' => status/error messages, 'body' => tab content
Get the current action selected from the bulk actions dropdown
_current_bulk_action() : string | false
Returns
string
false
The action name or False if no action was selected
Delete a custom field from the wp_postmeta table
_delete_custom_field(array $value) : array
Parameters
$value
array
specific custom_field_mapping rule
Returns
array
Message(s) reflecting the results of the operation
Serialize option settings and write them to a file
_export_settings() : array
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
Read a serialized file of option settings and write them to the database
_import_settings() : array
Returns
array
Message(s) reflecting the results of the operation
Process custom field settings against all image attachments
without saving the settings to the mla_option
_process_custom_field_mapping(array $settings) : array
since |
1.10 |
uses |
\global\$_REQUEST |
Parameters
$settings
array
| NULL specific custom_field_mapping values
Returns
array
Message(s) reflecting the results of the operation
Process IPTC/EXIF custom field settings against all image attachments
without saving the settings to the mla_option
_process_iptc_exif_custom(array $settings) : array
since |
1.00 |
uses |
\global\$_REQUEST |
Parameters
$settings
array
| NULL specific iptc_exif_custom_mapping values
Returns
array
Message(s) reflecting the results of the operation
Process IPTC/EXIF standard field settings against all image attachments
without saving the settings to the mla_option
_process_iptc_exif_standard() : array
since |
1.00 |
uses |
\global\$_REQUEST |
Returns
array
Message(s) reflecting the results of the operation
Process IPTC/EXIF taxonomy term settings against all image attachments
without saving the settings to the mla_option
_process_iptc_exif_taxonomy() : array
since |
1.00 |
uses |
\global\$_REQUEST |
Returns
array
Message(s) reflecting the results of the operation
Process an Optional Upload MIME Type selection
_process_optional_upload_mime(\intger $ID) : array
Parameters
$ID
\intger
MLA Optional Upload MIME Type ID
Returns
array
'message' => status/error messages, 'body' => tab content
Delete saved settings, restoring default values
_reset_general_settings() : array
Returns
array
Message(s) reflecting the results of the operation
Save custom field settings to the options table
_save_custom_field_settings(array $new_values) : array
since |
1.10 |
uses |
\global\$_REQUEST |
Parameters
$new_values
array
| NULL specific custom_field_mapping values
Returns
array
Message(s) reflecting the results of the operation
Save MLA Gallery settings to the options table
_save_gallery_settings() : array
since |
0.80 |
uses |
\global\$_REQUEST |
Returns
array
Message(s) reflecting the results of the operation
Save General settings to the options table
_save_general_settings() : array
since |
0.1 |
uses |
\global\$_REQUEST |
Returns
array
Message(s) reflecting the results of the operation
Save IPTC/EXIF custom field settings to the options table
_save_iptc_exif_custom_settings(array $new_values) : array
Parameters
$new_values
array
specific iptc_exif_custom_mapping values
Returns
array
Message(s) reflecting the results of the operation
Save IPTC/EXIF settings to the options table
_save_iptc_exif_settings() : array
since |
1.00 |
uses |
\global\$_REQUEST |
Returns
array
Message(s) reflecting the results of the operation
Save Upload settings to the options table
_save_upload_settings() : array
since |
1.40 |
uses |
\global\$_REQUEST |
Returns
array
Message(s) reflecting the results of the operation
Save View settings to the options table
_save_view_settings() : array
since |
1.40 |
uses |
\global\$_REQUEST |
Returns
array
Message(s) reflecting the results of the operation
Update or delete a single MLA option value
_update_option_row(string $key, array $value) : string
since |
0.80 |
uses |
\global\$_REQUEST |
Parameters
$key
string
HTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
$value
array
Option parameters, e.g., 'type', 'std'
Returns
string
HTML markup for the option's table row
Database and option update check, for installing new versions
_version_upgrade() : void
Properties
Holds screen id to match help text to corresponding screen
$current_page_hook : array
Definitions for Settings page tab ids, titles and handlers
Each tab is defined by an array with the following elements:
$mla_tablist : array
The array must be populated at runtime in MLASettings::mla_localize_tablist(),
because Localization calls cannot be placed in the "public static" array definition itself.
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';
Template file for the Settings page(s) and parts
$page_template_array : array
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.
Constants
Object name for localizing JavaScript - MLA View List Table
JAVASCRIPT_INLINE_EDIT_UPLOAD_OBJECT : string
Slug for localizing and enqueueing JavaScript - MLA View List Table
JAVASCRIPT_INLINE_EDIT_UPLOAD_SLUG : string
Object name for localizing JavaScript - MLA View List Table
JAVASCRIPT_INLINE_EDIT_VIEW_OBJECT : string
Slug for localizing and enqueueing JavaScript - MLA View List Table
JAVASCRIPT_INLINE_EDIT_VIEW_SLUG : string
Provides a unique name for the settings page
MLA_SETTINGS_SLUG