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
arrayarray of links for the Plugin, e.g., "Activate"
$file
stringDirectory and name of the plugin Index file
Returns
arrayUpdated 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
stringName 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
arrayDisplay template array
$name
stringHTML name attribute value
$selection
stringcurrently selected Icon Type
Returns
stringHTML 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
Ajax handler for Custom Fields tab inline mapping
mla_inline_mapping_custom_action() : void
Ajax handler for IPTC/EXIF tab inline mapping
mla_inline_mapping_iptc_exif_action() : void
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
booleanTrue to display "Screen Options", false to suppress them
$this_screen
stringName of the page being loaded
Returns
booleanTrue 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
mixedfalse or value returned by previous filter
$option
stringName of the option being changed
$value
stringNew value of the option
Returns
stringvoidNew 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 Debug tab content for the Settings subpage
_compose_debug_tab() : array
| since |
2.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
arraydata values for the item
$templates
stringDisplay 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
arraydata values for the item
$template
stringDisplay 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
stringHTML 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
stringHTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
$value
arrayOption parameters, e.g., 'type', 'std'
Returns
stringHTML 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
stringDisplay 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
stringOptional data-tab-id value for the active tab, default 'general'
Returns
stringHTML 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
stringfalseThe 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
arrayspecific custom_field_mapping rule
Returns
arrayMessage(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
arrayMessage(s) reflecting the results of the operation
Read a serialized file of option settings and write them to the database
_import_settings() : array
Returns
arrayMessage(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, integer $offset, integer $length) : array
| since |
1.10 |
| uses |
\global\$_REQUEST |
Parameters
$settings
array| NULL specific custom_field_mapping values
$offset
integeroffset for chunk mapping
$length
integerlength for chunk mapping
Returns
arrayMessage(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, integer $offset, integer $length) : array
| since |
1.00 |
| uses |
\global\$_REQUEST |
Parameters
$settings
array| NULL specific iptc_exif_custom_mapping values
$offset
integeroffset for chunk mapping
$length
integerlength for chunk mapping
Returns
arrayMessage(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(integer $offset, integer $length) : array
| since |
1.00 |
| uses |
\global\$_REQUEST |
Parameters
$offset
integeroffset for chunk mapping
$length
integerlength for chunk mapping
Returns
arrayMessage(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(integer $offset, integer $length) : array
| since |
1.00 |
| uses |
\global\$_REQUEST |
Parameters
$offset
integeroffset for chunk mapping
$length
integerlength for chunk mapping
Returns
arrayMessage(s) reflecting the results of the operation
Process an Optional Upload MIME Type selection
_process_optional_upload_mime(\intger $ID) : array
Parameters
$ID
\intgerMLA 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
arrayMessage(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
arrayMessage(s) reflecting the results of the operation
Save Debug settings to the options table
_save_debug_settings() : array
| since |
2.10 |
| uses |
\global\$_REQUEST |
Returns
arrayMessage(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
arrayMessage(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
arrayMessage(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
arrayspecific iptc_exif_custom_mapping values
Returns
arrayMessage(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
arrayMessage(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
arrayMessage(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
arrayMessage(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
stringHTML id/name attribute and option database key (OMIT MLA_OPTION_PREFIX)
$value
arrayOption parameters, e.g., 'type', 'std'
Returns
stringHTML markup for the option's table row
Database and option update check, for installing new versions
_version_upgrade() : void
Localize $mla_option_definitions array
mla_get_options_tablist(string $tab) : array | false
Localization must be done at runtime, and these calls cannot be placed
in the "public static" array definition itself.
Parameters
$tab
stringTab slug, to retrieve a single entry
Returns
arrayfalseThe entire tablist ( $tab = NULL ), a single tab entry or false if not found/not allowed
Properties
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.
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
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(),
because Localization calls cannot be placed in the "public static" array definition itself.
Constants
Object name for localizing JavaScript - MLA Upload List Table
JAVASCRIPT_INLINE_EDIT_UPLOAD_OBJECT : string
Slug for localizing and enqueueing JavaScript - MLA Upload 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
Slug for localizing and enqueueing JavaScript - MLA Custom tab
JAVASCRIPT_INLINE_MAPPING_CUSTOM_SLUG : string
Slug for localizing and enqueueing JavaScript - MLA IPTC/EXIF tab
JAVASCRIPT_INLINE_MAPPING_IPTC_EXIF_SLUG : string
Object name for localizing JavaScript - MLA Custom and IPTC/EXIF tabs
JAVASCRIPT_INLINE_MAPPING_OBJECT : string
Provides a unique name for the settings page
MLA_SETTINGS_SLUG : string