Class MLA (Media Library Assistant) Core is the minimum support required for all other MLA features
Methods
Define the Media/Assistant submenu screen to the Admin Columns plugin
admin_columns_support(array $storage_models, object $cpac)
Parameters
$storage_models
array
List of storage model class instances ( [key] => [CPAC_Storage_Model object] )
$cpac
object
CPAC, the root CodePress Admin Columns object
Initialization function, similar to __construct()
initialize() : void
Evaluate support information for custom field mapping
mla_custom_field_support(string $support_type) : array
Parameters
$support_type
string
array format; 'default_columns' (default), 'default_hidden_columns', 'default_sortable_columns', 'quick_edit' or 'bulk_edit'
Returns
array
default, hidden, sortable quick_edit or bulk_edit colums in appropriate format
Add a debug message to the collection
mla_debug_add(string $message, integer $debug_level)
Parameters
$message
string
Message text
$debug_level
integer
Optional. Debug category.
Get debug information without clearing the buffer
mla_debug_content(string $format, string $glue) : boolean
Parameters
$format
string
Return data type: 'string' (default) or 'array'
$glue
string
Join array elements with '\n' or '
<
p>' (default)
Returns
boolean
true if success else false
Get/Set debug information collection output file for mode = 'log'
mla_debug_file(string $file) : string
Note that WP_CONTENT_DIR will be pre-pended to the value, and a slash
will be added to the front of the value if necessary.
Parameters
$file
string
Optional. The (optional path and) file name, relative to WP_CONTENT_DIR, or false/empty string to clear the value.
Returns
string
The previous file value, i.e., before the update, relative to WP_CONTENT_DIR
Flush debug information and clear buffer
mla_debug_flush(string $destination, boolean $stop_collecting) : string
Parameters
$destination
string
Destination: 'buffer' (default), 'console', 'log' or 'none'
$stop_collecting
boolean
true (default) to stop, false to continue collection
Returns
string
debug content if $destination == 'buffer' else empty string
Get/Set debug information collection mode
mla_debug_mode(string $mode) : string
Parameters
$mode
string
Optional. New collection mode: 'none' (default), 'buffer', 'console' or 'log'
Returns
string
The previous mode value, i.e., before the update
Delete the stored value of a defined MLA option
mla_delete_option(string $option, array $option_table) : boolean
Parameters
$option
string
Name of the desired option
$option_table
array
Custom option definitions
Returns
boolean
True if the option was deleted, otherwise false
Return the stored value or default value of a defined MLA option
mla_get_option(string $option, boolean $get_default, boolean $get_stored, array $option_table) : mixed
Parameters
$option
string
Name of the desired option
$get_default
boolean
True to ignore current setting and return default values
$get_stored
boolean
True to ignore default values and return only stored values
$option_table
array
Custom option definitions
Returns
mixed
Value(s) for the option or false if the option is not a defined MLA option
Initialize "tax_checked_on_top" => "checked" default for all supported taxonomies
mla_initialize_tax_checked_on_top() : void
Called after all taxonomies are registered, e.g., in MLAObjects::_build_taxonomies.
Load an HTML template from a file
mla_load_template(string $source, string $type) : string | array | false | NULL
Loads a template to a string or a multi-part template to an array.
Multi-part templates are divided by comments of the form ,
where "key" becomes the key part of the array.
Parameters
$source
string
Complete path and/or name of the template file, option name or the raw template
$type
string
Optional type of template source; 'path', 'file' (default), 'option', 'string'
Returns
string
array
false
NULL
string for files that do not contain template divider comments, array for files containing template divider comments, false if file or option does not exist, NULL if file could not be loaded.
Analyze a Library View/Post MIME Type specification, returning an array of the placeholders it contains
mla_parse_view_specification(string | array $specification) : array
Parameters
$specification
stringarray
A specification, e.g., "custom:Field,null" or "audio,application/vnd.ms"
Returns
array
( ['prefix'] => string, ['name'] => string, ['value'] => string, ['option'] => string, optional ['error'] => string )
Load a plugin text domain and alternate debug file
mla_plugins_loaded_action() : void
The "add_action" for this function is in mla-plugin-loader.php, because the "initialize"
function above doesn't run in time.
Defined as public because it's an action.
Convert a Library View/Post MIME Type specification to WP_Query parameters
mla_prepare_view_query(string $slug, string $specification) : array
Parameters
$slug
string
View slug, unique identifier
$specification
string
A specification, e.g., "custom:Field,null" or "audio,application/vnd.ms"
Returns
array
post_mime_type specification or custom field query
Returns an array of taxonomy names assigned to $support_type
mla_supported_taxonomies(string $support_type) : array
Parameters
$support_type
string
Optional. 'support' (default), 'quick-edit', 'flat-checklist', 'term-search' or 'filter'
Returns
array
taxonomies assigned to $support_type; can be empty.
Determine MLA support for a taxonomy, handling the special case where the
settings are being updated or reset.
mla_taxonomy_support(string $tax_name, string $support_type) : boolean | string
Parameters
$tax_name
string
Taxonomy name, e.g., attachment_category
$support_type
string
Optional. 'support' (default), 'quick-edit' or 'filter'
Returns
boolean
string
true if the taxonomy is supported in this way else false. string if $tax_name is '' and $support_type is 'filter', returns the taxonomy to filter by.
Add or update the stored value of a defined MLA option
mla_update_option(string $option, mixed $newvalue, array $option_table) : boolean
Parameters
$option
string
Name of the desired option
$newvalue
mixed
New value for the desired option
$option_table
array
Custom option definitions
Returns
boolean
True if the value was changed or false if the update failed
Filter the redirect location.
mla_wp_redirect_filter(string $location, int $status)
Parameters
$location
string
The path to redirect to.
$status
int
Status code to use.
Write a debug message to the appropriate log file
_debug_log(string $message)
Parameters
$message
string
Message text
Properties
Admin Columns support storage model object for the Media/Assistant submenu
$admin_columns_storage_model : object
Effective MLA Debug Level, from MLA_DEBUG_LEVEL or override option
$mla_debug_level : integer
Original PHP error_log path and file
$original_php_log : string
Original PHP error_reporting value
$original_php_reporting : string
Option setting for "Featured in" reporting
$process_featured_in : boolean
This setting is false if the "Featured in" database access setting is "disabled", else true.
Option setting for "Gallery in" reporting
$process_gallery_in : boolean
This setting is false if the "Gallery in" database access setting is "disabled", else true.
Option setting for "Inserted in" reporting
$process_inserted_in : boolean
This setting is false if the "Inserted in" database access setting is "disabled", else true.
Option setting for "MLA Gallery in" reporting
$process_mla_gallery_in : boolean
This setting is false if the "MLA Gallery in" database access setting is "disabled", else true.
Debug information output file for mode = 'log'
$mla_debug_file : string
Accumulates debug messages
$mla_debug_messages : string
Debug information collection mode
$mla_debug_mode : string
Collection mode: 'buffer', 'console', 'log' or 'none' (default).
Constants
Slug for adding plugin submenu
ADMIN_PAGE_SLUG : string
Current version number (moved from class-mla-main.php)
CURRENT_MLA_VERSION : string
Slug for the "fill compat-attachment-fields" action - Add Media and related dialogs
JAVASCRIPT_FILL_COMPAT_ACTION : string
Slug for localizing and enqueueing JavaScript - MLA List Table
JAVASCRIPT_INLINE_EDIT_SLUG : string
Slug for the "query attachments" action - Add Media and related dialogs
JAVASCRIPT_QUERY_ATTACHMENTS_ACTION : string
Slug for the "update compat-attachment-fields" action - Add Media and related dialogs
JAVASCRIPT_UPDATE_COMPAT_ACTION : string
Action name; gives a context for the nonce
MLA_ADMIN_NONCE_ACTION : string
Nonce name; uniquely identifies the nonce
MLA_ADMIN_NONCE_NAME : string
mla_admin_action value for permanently deleting a single item
MLA_ADMIN_SINGLE_DELETE : string
mla_admin_action value for restoring a single item from the trash
MLA_ADMIN_SINGLE_RESTORE : string
mla_admin_action value for moving a single item to the trash
MLA_ADMIN_SINGLE_TRASH : string
Constant to log Ajax debug activity
MLA_DEBUG_CATEGORY_AJAX : integer
Constant to log "any" debug activity
MLA_DEBUG_CATEGORY_ANY : integer
Constant to log WPML/Polylang action/filter activity
MLA_DEBUG_CATEGORY_LANGUAGE : integer
Constant to log Ghostscript/Imagick activity
MLA_DEBUG_CATEGORY_THUMBNAIL : integer
Slug for registering and enqueueing plugin style sheets (moved from class-mla-main.php)
STYLESHEET_SLUG : string