# MLACore

Class MLA (Media Library Assistant) Core is the minimum support required for all other MLA features

package | Media Library Assistant
since | 2.20

### Methods

## Write a debug message to the appropriate log file

    _debug_log(string $message)

static

since | 2.14

### Arguments

#### $message

`string`

Message text

## Set MLA-specific inline editing strategy

    add_editing_strategy(\ACP_Editing_Model $model)

static

since | 2.50

### Arguments

#### $model

`\ACP_Editing_Model`

## Define the Media/Assistant submenu screen to the (old) Admin Columns plugin

    admin_columns_support_deprecated(array $storage_models, object $cpac)

static

since | 2.22

### Arguments

#### $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

static

since | 1.00

## Display taxonomy "checklist" form fields

    mla_checklist_meta_box( $target_post,  $box) : void

static

Adapted from /wp-admin/includes/ajax-actions.php function _wp_ajax_add_hierarchical_term(). Includes the "? Search" area to filter the term checklist by entering part or all of a word/phrase in the term label. Output to the Media/Edit Media screen and to the Media Manager Modal Window.

since | 1.71

### Arguments

#### $target_post

``

#### $box

``

## Evaluate support information for custom field mapping

    mla_custom_field_support( $support_type = 'default_columns') : array

static

since | 1.10

### Arguments

#### $support_type

``

### Response

`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 = NULL)

static

since | 2.12

### Arguments

#### $message

`string`

Message text

#### $debug_level

`integer`

Optional. Debug category.

## Get debug information without clearing the buffer

    mla_debug_content(string $format = 'string', string $glue = '<p>') : boolean

static

since | 2.12

### Arguments

#### $format

`string`

Return data type: 'string' (default) or 'array'

#### $glue

`string`

Join array elements with '\n' or '

' (default)

### Response

`boolean`

true if success else false

## Get/Set debug information collection output file for mode = 'log'

    mla_debug_file(string $file = NULL) : string

static

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.

since | 2.14

### Arguments

#### $file

`string`

Optional. The (optional path and) file name, relative to WP_CONTENT_DIR, or false/empty string to clear the value.

### Response

`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 = 'buffer', boolean $stop_collecting = true) : string

static

since | 2.12

### Arguments

#### $destination

`string`

Destination: 'buffer' (default), 'console', 'log' or 'none'

#### $stop_collecting

`boolean`

true (default) to stop, false to continue collection

### Response

`string`

debug content if $destination == 'buffer' else empty string

## Get/Set debug information collection mode

    mla_debug_mode(string $mode = false) : string

static

since | 2.12

### Arguments

#### $mode

`string`

Optional. New collection mode: 'none' (default), 'buffer', 'console' or 'log'

### Response

`string`

The previous mode value, i.e., before the update

## Delete the stored value of a defined MLA option

    mla_delete_option( $option,  &$option_table = NULL) : boolean

static

since | 2.20

### Arguments

#### $option

``

#### $option_table

``

### Response

`boolean`

True if the option was deleted, otherwise false

## Return the stored value or default value of a defined MLA option

    mla_get_option( $option,  $get_default = false,  $get_stored = false,  &$option_table = NULL) : mixed

static

since | 2.20

### Arguments

#### $option

``

#### $get_default

``

#### $get_stored

``

#### $option_table

``

### Response

`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

static

Called after all taxonomies are registered, e.g., in MLAObjects::_build_taxonomies.

since | 2.02

## Load an HTML template from a file

    mla_load_template( $source,  $type = 'file') : string|array|false|NULL

static

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.

since | 0.1

### Arguments

#### $source

``

#### $type

``

### Response

`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.

## Ensures that MLA media manager enhancements are present when required.

    mla_media_view_settings_filter( $settings,  $post)

static

Declared public because it is a filter.

since | 2.30

### Arguments

#### $settings

``

#### $post

``

## Analyze a Library View/Post MIME Type specification, returning an array of the placeholders it contains

    mla_parse_view_specification( $specification) : array

static

since | 1.40

### Arguments

#### $specification

``

### Response

`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

static

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.

since | 1.60

## Add the WPML suppress All languages filter

    mla_plugins_loaded_action_wpml() : void

static

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.

since | 2.32

## Convert a Library View/Post MIME Type specification to WP_Query parameters

    mla_prepare_view_query( $slug,  $specification) : array

static

since | 1.40

### Arguments

#### $slug

``

#### $specification

``

### Response

`array`

post_mime_type specification or custom field query

## Returns an array of taxonomy names assigned to $support_type

    mla_supported_taxonomies( $support_type = 'support') : array|string

static

since | 2.20

### Arguments

#### $support_type

``

### Response

`array|string`

array taxonomies assigned to $support_type; can be empty. string if $support_type is 'metakey', returns the custom field to filter by.

## Determine MLA support for a taxonomy, handling the special case where the settings are being updated or reset.

    mla_taxonomy_support( $tax_name,  $support_type = 'support') : boolean|string

static

since | 2.20

### Arguments

#### $tax_name

``

#### $support_type

``

### Response

`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. string if $support_type is 'metakey', returns the custom field to filter by.

## Add or update the stored value of a defined MLA option

    mla_update_option( $option,  $newvalue,  &$option_table = NULL) : boolean

static

since | 2.20

### Arguments

#### $option

``

#### $newvalue

``

#### $option_table

``

### Response

`boolean`

True if the value was changed or false if the update failed

## Registers and enqueues the mla-beaver-builder-style.css file, when needed.

    mla_wp_enqueue_media_action()

static

Declared public because it is an action.

since | 2.30

## Filter the redirect location.

    mla_wp_redirect_filter(string $location, integer $status)

static

since | 2.25

### Arguments

#### $location

`string`

The path to redirect to.

#### $status

`integer`

Status code to use.

## Create and register MLA-specific list screen handler for Admin Columns

    register_list_screen()

static

since | 2.50

## Restores All languages view to Media/Assistant submenu screen

    wpml_unset_lang_admin_bar( $suppress_all_languages)

static

since | 2.32

### Arguments

#### $suppress_all_languages

``

### Constants

## Current version number (moved from class-mla-main.php)

    CURRENT_MLA_VERSION

since |
var |

## Slug for registering and enqueueing plugin style sheets (moved from class-mla-main.php)

    STYLESHEET_SLUG

since |
var |

## Constant to log "any" debug activity

    MLA_DEBUG_CATEGORY_ANY

since |
var |

## Constant to log Ajax debug activity

    MLA_DEBUG_CATEGORY_AJAX

since |
var |

## Constant to log WPML/Polylang action/filter activity

    MLA_DEBUG_CATEGORY_LANGUAGE

since |
var |

## Constant to log Ghostscript/Imagick activity

    MLA_DEBUG_CATEGORY_THUMBNAIL

since |
var |

## Constant to log IPTC/EXIF/XMP/PDF metadata activity

    MLA_DEBUG_CATEGORY_METADATA

since |
var |

## Slug for adding plugin submenu

    ADMIN_PAGE_SLUG

since |
var |

## mla_admin_action value to display a single item for editing/viewing

    MLA_ADMIN_SINGLE_EDIT_DISPLAY

since |
var |

## mla_admin_action value to install an example plugin

    MLA_ADMIN_SINGLE_EDIT_INSTALL

since |
var |

## mla_admin_action value for updating a single item

    MLA_ADMIN_SINGLE_EDIT_UPDATE

since |
var |

## mla_admin_action value for mapping Custom Field metadata

    MLA_ADMIN_SINGLE_CUSTOM_FIELD_MAP

since |
var |

## mla_admin_action value for purging Custom Field values

    MLA_ADMIN_SINGLE_CUSTOM_FIELD_PURGE

since |
var |

## mla_admin_action value for mapping IPTC/EXIF metadata

    MLA_ADMIN_SINGLE_MAP

since |
var |

## mla_admin_action value for purging IPTC/EXIF metadata

    MLA_ADMIN_SINGLE_PURGE

since |
var |

## mla_admin_action value for setting an item's parent object

    MLA_ADMIN_SET_PARENT

since |
var |

## mla_admin_action value for searching taxonomy terms

    MLA_ADMIN_TERMS_SEARCH

since |
var |

## mla_admin_action value for permanently deleting a single item

    MLA_ADMIN_SINGLE_DELETE

since |
var |

## mla_admin_action value for moving a single item to the trash

    MLA_ADMIN_SINGLE_TRASH

since |
var |

## mla_admin_action value for restoring a single item from the trash

    MLA_ADMIN_SINGLE_RESTORE

since |
var |

## mla_admin_action value for copying a single item

    MLA_ADMIN_SINGLE_COPY

since |
var |

## mla_admin_action value for copying a single item

    MLA_ADMIN_SINGLE_ADD

since |
var |

## Action name; gives a context for the nonce

    MLA_ADMIN_NONCE_ACTION

since |
var |

## Nonce name; uniquely identifies the nonce

    MLA_ADMIN_NONCE_NAME

since |
var |

## Slug for localizing and enqueueing JavaScript - MLA List Table

    JAVASCRIPT_INLINE_EDIT_SLUG

since |
var |

## Slug for the "query attachments" action - Add Media and related dialogs

    JAVASCRIPT_QUERY_ATTACHMENTS_ACTION

since |
var |

## Slug for the "fill compat-attachment-fields" action - Add Media and related dialogs

    JAVASCRIPT_FILL_COMPAT_ACTION

since |
var |

## Slug for the "update compat-attachment-fields" action - Add Media and related dialogs

    JAVASCRIPT_UPDATE_COMPAT_ACTION

since |
var |

### Properties

## Original PHP error_log path and file

    original_php_log : string

static

since |
var |

### Type(s)

`string`

## Original PHP error_reporting value

    original_php_reporting : string

static

since |
var |

### Type(s)

`string`

## Option setting for "Featured in" reporting

    process_featured_in : boolean

static

This setting is false if the "Featured in" database access setting is "disabled", else true.

since |
var |

### Type(s)

`boolean`

## Option setting for "Inserted in" reporting

    process_inserted_in : boolean

static

This setting is false if the "Inserted in" database access setting is "disabled", else true.

since |
var |

### Type(s)

`boolean`

## Option setting for "Gallery in" reporting

    process_gallery_in : boolean

static

This setting is false if the "Gallery in" database access setting is "disabled", else true.

since |
var |

### Type(s)

`boolean`

## Option setting for "MLA Gallery in" reporting

    process_mla_gallery_in : boolean

static

This setting is false if the "MLA Gallery in" database access setting is "disabled", else true.

since |
var |

### Type(s)

`boolean`

## Effective MLA Debug Level, from MLA_DEBUG_LEVEL or override option

    mla_debug_level : integer

static

since |
var |

### Type(s)

`integer`

## Accumulates debug messages

    mla_debug_messages : string

static

since |
var |

### Type(s)

`string`

## Debug information collection mode

    mla_debug_mode : string

static

Collection mode: 'buffer', 'console', 'log' or 'none' (default).

since |
var |

### Type(s)

`string`

## Debug information output file for mode = 'log'

    mla_debug_file : string

static

since |
var |

### Type(s)

`string`

## Admin Columns support storage model object for the Media/Assistant submenu

    admin_columns_storage_model : object

static

since |
var |

### Type(s)

`object`