Constants

CURRENT_MLA_VERSION

CURRENT_MLA_VERSION

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

STYLESHEET_SLUG

STYLESHEET_SLUG

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

MLA_DEBUG_CATEGORY_ANY

MLA_DEBUG_CATEGORY_ANY

Constant to log "any" debug activity

MLA_DEBUG_CATEGORY_AJAX

MLA_DEBUG_CATEGORY_AJAX

Constant to log Ajax debug activity

MLA_DEBUG_CATEGORY_LANGUAGE

MLA_DEBUG_CATEGORY_LANGUAGE

Constant to log WPML/Polylang action/filter activity

MLA_DEBUG_CATEGORY_THUMBNAIL

MLA_DEBUG_CATEGORY_THUMBNAIL

Constant to log Ghostscript/Imagick activity

ADMIN_PAGE_SLUG

ADMIN_PAGE_SLUG

Slug for adding plugin submenu

MLA_ADMIN_SINGLE_DELETE

MLA_ADMIN_SINGLE_DELETE

mla_admin_action value for permanently deleting a single item

MLA_ADMIN_SINGLE_TRASH

MLA_ADMIN_SINGLE_TRASH

mla_admin_action value for moving a single item to the trash

MLA_ADMIN_SINGLE_RESTORE

MLA_ADMIN_SINGLE_RESTORE

mla_admin_action value for restoring a single item from the trash

MLA_ADMIN_NONCE_ACTION

MLA_ADMIN_NONCE_ACTION

Action name; gives a context for the nonce

MLA_ADMIN_NONCE_NAME

MLA_ADMIN_NONCE_NAME

Nonce name; uniquely identifies the nonce

JAVASCRIPT_INLINE_EDIT_SLUG

JAVASCRIPT_INLINE_EDIT_SLUG

Slug for localizing and enqueueing JavaScript - MLA List Table

JAVASCRIPT_QUERY_ATTACHMENTS_ACTION

JAVASCRIPT_QUERY_ATTACHMENTS_ACTION

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

JAVASCRIPT_FILL_COMPAT_ACTION

JAVASCRIPT_FILL_COMPAT_ACTION

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

JAVASCRIPT_UPDATE_COMPAT_ACTION

JAVASCRIPT_UPDATE_COMPAT_ACTION

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

Properties

$original_php_log

$original_php_log : string

Original PHP error_log path and file

Type

string

$original_php_reporting

$original_php_reporting : string

Original PHP error_reporting value

Type

string

$process_featured_in

$process_featured_in : boolean

Option setting for "Featured in" reporting

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

Type

boolean

$process_inserted_in

$process_inserted_in : boolean

Option setting for "Inserted in" reporting

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

Type

boolean

$process_gallery_in

$process_gallery_in : boolean

Option setting for "Gallery in" reporting

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

Type

boolean

$process_mla_gallery_in

$process_mla_gallery_in : boolean

Option setting for "MLA Gallery in" reporting

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

Type

boolean

$mla_debug_level

$mla_debug_level : integer

Effective MLA Debug Level, from MLA_DEBUG_LEVEL or override option

Type

integer

$admin_columns_storage_model

$admin_columns_storage_model : object

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

Type

object

$mla_debug_messages

$mla_debug_messages : string

Accumulates debug messages

Type

string

$mla_debug_mode

$mla_debug_mode : string

Debug information collection mode

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

Type

string

$mla_debug_file

$mla_debug_file : string

Debug information output file for mode = 'log'

Type

string

Methods

initialize()

initialize() : void

Initialization function, similar to __construct()

mla_media_view_settings_filter()

mla_media_view_settings_filter(  $settings,   $post) 

Ensures that MLA media manager enhancements are present when required.

Declared public because it is a filter.

Parameters

$settings
$post

mla_wp_enqueue_media_action()

mla_wp_enqueue_media_action() 

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

Declared public because it is an action.

mla_plugins_loaded_action_wpml()

mla_plugins_loaded_action_wpml() : void

Add the WPML suppress All languages filter

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.

wpml_unset_lang_admin_bar()

wpml_unset_lang_admin_bar(  $suppress_all_languages) 

Restores All languages view to Media/Assistant submenu screen

Parameters

$suppress_all_languages

mla_plugins_loaded_action()

mla_plugins_loaded_action() : void

Load a plugin text domain and alternate debug file

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.

mla_wp_redirect_filter()

mla_wp_redirect_filter(string  $location, integer  $status) 

Filter the redirect location.

Parameters

string $location

The path to redirect to.

integer $status

Status code to use.

mla_initialize_tax_checked_on_top()

mla_initialize_tax_checked_on_top() : void

Initialize "tax_checked_on_top" => "checked" default for all supported taxonomies

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

mla_get_option()

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

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

Parameters

$option
$get_default
$get_stored
$option_table

Returns

mixed —

Value(s) for the option or false if the option is not a defined MLA option

mla_update_option()

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

Add or update the stored value of a defined MLA option

Parameters

$option
$newvalue
$option_table

Returns

boolean —

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

mla_delete_option()

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

Delete the stored value of a defined MLA option

Parameters

$option
$option_table

Returns

boolean —

True if the option was deleted, otherwise false

mla_load_template()

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

Load an HTML template from a file

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

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.

mla_taxonomy_support()

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

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

Parameters

$tax_name
$support_type

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

mla_supported_taxonomies()

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

Returns an array of taxonomy names assigned to $support_type

Parameters

$support_type

Returns

array|string —

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

mla_custom_field_support()

mla_custom_field_support(  $support_type = 'default_columns') : array

Evaluate support information for custom field mapping

Parameters

$support_type

Returns

array —

default, hidden, sortable quick_edit or bulk_edit colums in appropriate format

mla_prepare_view_query()

mla_prepare_view_query(  $slug,   $specification) : array

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

Parameters

$slug
$specification

Returns

array —

post_mime_type specification or custom field query

mla_parse_view_specification()

mla_parse_view_specification(  $specification) : array

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

Parameters

$specification

Returns

array —

( ['prefix'] => string, ['name'] => string, ['value'] => string, ['option'] => string, optional ['error'] => string )

mla_checklist_meta_box()

mla_checklist_meta_box(  $target_post,   $box) : void

Display taxonomy "checklist" form fields

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.

Parameters

$target_post
$box

mla_debug_mode()

mla_debug_mode(string  $mode = false) : string

Get/Set debug information collection mode

Parameters

string $mode

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

Returns

string —

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

mla_debug_file()

mla_debug_file(string  $file = NULL) : string

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

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

string $file

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

mla_debug_content()

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

Get debug information without clearing the buffer

Parameters

string $format

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

string $glue

Join array elements with '\n' or '

' (default)

Returns

boolean —

true if success else false

mla_debug_flush()

mla_debug_flush(string  $destination = 'buffer', boolean  $stop_collecting = true) : string

Flush debug information and clear buffer

Parameters

string $destination

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

boolean $stop_collecting

true (default) to stop, false to continue collection

Returns

string —

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

mla_debug_add()

mla_debug_add(string  $message, integer  $debug_level = NULL) 

Add a debug message to the collection

Parameters

string $message

Message text

integer $debug_level

Optional. Debug category.

admin_columns_support()

admin_columns_support(array  $storage_models, object  $cpac) 

Define the Media/Assistant submenu screen to the Admin Columns plugin

Parameters

array $storage_models

List of storage model class instances ( [key] => [CPAC_Storage_Model object] )

object $cpac

CPAC, the root CodePress Admin Columns object

_debug_log()

_debug_log(string  $message) 

Write a debug message to the appropriate log file

Parameters

string $message

Message text