\MLAData_Source

Class MLA (Media Library Assistant) Data Source manages data sources for custom field mapping and shortcode execution

Summary

Methods
Properties
Constants
mla_is_data_source()
mla_get_data_source()
$custom_field_data_sources
No constants found
No protected methods found
No protected properties found
N/A
_evaluate_file_information()
_evaluate_post_information()
_evaluate_array_result()
_evaluate_data_source()
No private properties found
N/A

Properties

$custom_field_data_sources

$custom_field_data_sources : array

Array of Data Source names for custom field mapping

Type

array

Methods

mla_is_data_source()

mla_is_data_source(  $candidate_name) : boolean

Identify custom field mapping data source

Determines whether a name matches any of the element-level data source dropdown options, i.e., excludes "template:" and "meta:" values.

Parameters

$candidate_name

Returns

boolean —

true if candidate name matches a data source

mla_get_data_source()

mla_get_data_source(  $post_id,   $category,   $data_value,   $attachment_metadata = NULL) : string|array

Get IPTC/EXIF or custom field mapping data source

Defined as public so MLA Mapping Hooks clients can call it. Isolates clients from changes to _evaluate_data_source().

Parameters

$post_id
$category
$data_value
$attachment_metadata

Returns

string|array —

data source value

_evaluate_file_information()

_evaluate_file_information(  $upload_dir,   $wp_attached_files,   $wp_attachment_metadata,   $post_id) : array

Evaluate file information for custom field mapping

Parameters

$upload_dir
$wp_attached_files
$wp_attachment_metadata
$post_id

Returns

array —

absolute_path_raw, absolute_path, absolute_file_name_raw, absolute_file_name, absolute_file, base_file, path, file_name, extension, dimensions, width, height, hwstring_small, array of intermediate sizes

_evaluate_post_information()

_evaluate_post_information(  $post_id,   $category,   $data_source) : mixed

Evaluate post information for custom field mapping

Parameters

$post_id
$category
$data_source

Returns

mixed —

(string)/'' or (integer)/0 depending on $data_source type

_evaluate_array_result()

_evaluate_array_result(  $value,   $option,   $keep_existing) : mixed

Evaluate post information for custom field mapping

Parameters

$value
$option
$keep_existing

Returns

mixed —

array for option = array|multi else string

_evaluate_data_source()

_evaluate_data_source(  $post_id,   $category,   $data_value,   $attachment_metadata = NULL) : string|array

Evaluate custom field mapping data source

Parameters

$post_id
$category
$data_value
$attachment_metadata

Returns

string|array —

data source value