initialize()
mla_IPTC_EXIF_error_handler()
mla_apply_field_level_format()
mla_count_list_table_items()
mla_exif_metadata_value()
mla_expand_field_level_parameters()
mla_fetch_attachment_id3_metadata()
mla_fetch_attachment_image_metadata()
mla_find_array_element()
mla_get_attachment_by_id()
mla_get_template_placeholders()
mla_hex_dump()
mla_id3_metadata_value()
mla_iptc_metadata_value()
mla_parse_array_template()
mla_parse_pdf_date()
mla_parse_template()
mla_parse_xmp_metadata()
mla_pdf_metadata_value()
mla_query_list_table_items()
mla_save_post_action()
mla_update_item_postmeta()
mla_update_single_item()
mla_update_wp_attachment_metadata()
mla_xmp_metadata_value()
_bin_to_utf8()
_evaluate_template_array_node()
_evaluate_template_node()
_expand_field_level_template()
_find_template_substring()
_find_test_substring()
_nonempty_value()
_parse_arguments()
_parse_field_level_template()
_parse_iso8601_date()
_parse_xmp_array()
_process_field_level_array()
_rational_to_decimal()
_rational_to_string()
_remove_terms()
_set_array_element()
_unset_array_element()
$mla_iptc_keys
$query_parameters
$search_parameters
$utf8_chars
$mla_IPTC_EXIF_errors
$mla_iptc_descriptions
$mla_iptc_formats
$mla_iptc_image_types
$mla_iptc_records
Class MLA (Media Library Assistant) Data provides database and template file access for MLA needs
The _template functions are inspired by the book "WordPress 3 Plugin Development Essentials." Templates separate HTML markup from PHP code for easier maintenance and localization.
package | Media Library Assistant |
---|---|
since | 0.1 |
initialize()
since | 0.1 |
---|
mla_IPTC_EXIF_error_handler(int $type, string $string, string $file, int $line) : boolean
since | 1.81 |
---|
int
the level of the error raised
string
the error message
string
the filename that the error was raised in
int
the line number the error was raised at
boolean
true, to bypass PHP error handlermla_apply_field_level_format(string $value, array $args) : string
since | 2.10 |
---|
string
field-level content
array
format code and aguments
string
formatted field-level contentmla_count_list_table_items(array $request, int $offset, int $count) : integer
Compatibility shim for MLAQuery::mla_count_list_table_items
since | 0.30 |
---|
array
Query variables, e.g., from $_REQUEST
int
(optional) number of rows to skip over to reach desired page
int
(optional) number of rows on each page
integer
Number of attachment postsmla_find_array_element(string $needle, array $haystack, string $option, boolean $keep_existing) : mixed
Used primarily to extract fields from the _wp_attachment_metadata custom field. Also used with the audio/video ID3 metadata exposed in WordPress 3.6 and later.
since | 1.30 |
---|
string
key value, e.g. array1.array2.element
array
PHP nested arrays
string
data option; 'text'|'single'|'export'|'array'|'multi'
boolean
keep existing values - for 'multi' option
mixed
string or array value matching key(.key ...) or ''mla_get_template_placeholders(string $tpl, string $default_option) : array
since | 0.90 |
---|
string
A formatting string containing [+placeholders+]
string
Optional: default option value
array
Placeholder information: each entry is an array with ['prefix'] => string, ['value'] => string, ['option'] => string 'text'|single'|'export'|'array'|'multi'mla_hex_dump(string $data, integer $limit, \intger $bytes_per_row, integer $offset) : string
since | 0.90 |
---|
string
Binary data
integer
Bytes to format, default = 0 (all bytes)
\intger
Bytes to format on each line
integer
offset of initial byte, or -1 to suppress printing offset information
string
Printable representation of $datamla_parse_array_template(string $tpl, array $markup_values) : mixed
Will return an array of values if one or more of the placeholders returns an array.
since | 1.50 |
---|
string
A formatting string containing [+placeholders+]
array
An associative array containing keys and values e.g. array('key' => 'value')
mixed
string or array, depending on placeholder values. Placeholders corresponding to the keys of the markup_values will be replaced with their values.mla_parse_pdf_date(string $source_string) : string
since | 1.50 |
---|
string
PDF date string of the form D:YYYYMMDDHHmmSSOHH'mm
string
formatted date string YYYY-MM-DD HH:mm:SSmla_parse_template(string $tpl, array $markup_values) : \strng
A simple parsing function for basic templating.
since | 0.1 |
---|
string
A formatting string containing [+placeholders+]
array
An associative array containing keys and values e.g. array('key' => 'value')
\strng
Placeholders corresponding to the keys of the markup_values will be replaced with their values.mla_query_list_table_items(array $request, int $offset, int $count) : array
Compatibility shim for MLAQuery::mla_query_list_table_items
since | 0.1 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
number of rows to skip over to reach desired page
int
number of rows on each page
array
attachment objects (posts) including parent data, meta data and referencesmla_save_post_action(integer $post_id) : void
since | 1.00 |
---|
integer
ID of post/page/attachment; not used at this time
mla_update_single_item(int $post_id, array $new_data, array $tax_input, array $tax_actions) : array
since | 0.1 |
---|
int
The ID of the attachment to be updated
array
Field name => value pairs
array
Optional taxonomy term values, default null
array
Optional taxonomy actions (add, remove, replace), default null
array
success/failure message and NULL content_bin_to_utf8(string $string) : string
since | 1.41 |
---|
string
unencoded string
string
UTF-8 encoded string_evaluate_template_array_node(array $node, array $markup_values) : mixed
Will return an array of values if one or more of the placeholders returns an array.
since | 1.50 |
---|
array
A field-level template element node
array
An array of markup substitution values
mixed
string or array, depending on placeholder values. Placeholders corresponding to the keys of the markup_values will be replaced with their values._evaluate_template_node(array $node, array $markup_values) : string
since | 1.50 |
---|
array
A field-level template element node
array
An array of markup substitution values
string
String with expanded values, if any_find_template_substring(string $tpl) : string
since | 1.50 |
---|
string
A string possibly starting with '[+template:'
string
'' or template string starting with '[+template:' and ending with the matching '+]'_find_test_substring(string $tpl) : string
since | 1.50 |
---|
string
A string possibly starting with '('
string
'' or template string starting with '(' and ending with the matching ')'_nonempty_value(array $namespace_array, string $namespace, string $key) : string
since | 2.10 |
---|
array
namespace array
string
namespace
string
key
string
trimmed value of the key within the namespace_parse_arguments(string $argument_string) : array
since | 2.02 |
---|
string
arguments, e.g., ('d/m/Y H:i:s' , "arg, \" two" ) without parens
array
individual arguments, e.g. array( 0 => 'd/m/Y H:i:s', 1 => 'arg, \" two' )_parse_field_level_template(string $tpl) : array
since | 1.50 |
---|
string
Template content with string, test and choice elements
array
( node => array( type => "string | test | choice | template", length => bytes, value => string | node(s) ) )_parse_iso8601_date(string $source_string) : string
since | 1.50 |
---|
string
ISO string of the form YYYY-MM-DDTHH:MM:SS-HH:MM (inc time zone)
string
formatted date string YYYY-MM-DD HH:mm:SS_parse_xmp_array(array $values) : mixed
since | 2.10 |
---|
array
XMP multi-valued element
mixed
Simplified array or string value_process_field_level_array(array $record, string $option, boolean $keep_existing) : array
since | 1.50 |
---|
array
an array of scalar values
string
data option; 'text'|'single'|'export'|'array'|'multi'
boolean
Optional: for option 'multi', retain existing values
array
( parameter => value ) for all field-level parameters and anything in $markup_values_rational_to_decimal(array $rational) : float
since | 1.50 |
---|
array
array( 0 => numerator, 1 => denominator )
float
numerator/denominator_rational_to_string(string $rational, string $integer_format, string $fraction_format, string $mixed_format) : mixed
since | 2.02 |
---|
string
numerator/denominator
string
format for integer values
string
format for fractional values from -1 to +1
string
format for integer.fraction values
mixed
formatted value or boolean false if no value available_remove_terms(integer $post_id, array $terms, object $taxonomy_obj) : array
since | 0.40 |
---|
integer
The ID of the attachment to be updated
array
The term ids (integer array) or names (string array) to remove
object
The taxonomy object
array
Term ids/names of the surviving terms_set_array_element(string $needle, mixed $value, array $haystack) : boolean
since | 1.51 |
---|
string
key value, e.g. array1.array2.element
mixed
replacement value, string or array, by reference
array
PHP nested arrays, by reference
boolean
true if $needle element set, false if not_unset_array_element(string $needle, array $haystack) : boolean
since | 1.51 |
---|
string
key value, e.g. array1.array2.element
array
PHP nested arrays, by reference
boolean
true if $needle element found, false if not$mla_iptc_keys : array
This array contains the sanitized names and identifiers of Datasets defined in the "IPTC-NAA Information Interchange Model Version No. 4.1".
since | 0.90 |
---|
$query_parameters : array
This array defines parameters for the query's join, where and orderby filters. The parameters are set up in the _prepare_list_table_query function, and any further logic required to translate those values is contained in the filters.
Array index values are: use_alt_text_view, use_postmeta_view, use_orderby_view, alt_text_value, postmeta_key, postmeta_value, patterns, detached, orderby, order, mla-metavalue, debug (also in search_parameters)
since | 0.30 |
---|
$search_parameters : array
This array defines parameters for the query's posts_search filter, which uses 'search_string' to add a clause to the query's WHERE clause. It is shared between the list_table-query functions here and the mla_get_shortcode_attachments function in class-mla-shortcodes.php. This array passes the relevant parameters to the filter.
Array index values are: ['mla_terms_search']['phrases'] ['mla_terms_search']['taxonomies'] ['mla_terms_search']['radio_phrases'] => AND/OR ['mla_terms_search']['radio_terms'] => AND/OR ['s'] => numeric for ID/parent search ['mla_search_fields'] => 'content', 'title', 'excerpt', 'alt-text', 'name', 'terms' Note: 'alt-text' is not supported in [mla_gallery] ['mla_search_connector'] => AND/OR ['sentence'] => entire string must match as one "keyword" ['exact'] => entire string must match entire field value ['debug'] => internal element, console/log/shortcode/none ['tax_terms_count'] => internal element, shared with JOIN and GROUP BY filters
since | 2.00 |
---|
$utf8_chars : array
since | 1.41 |
---|
$mla_IPTC_EXIF_errors : array
since | 1.81 |
---|
$mla_iptc_descriptions : array
This array contains the descriptions of Datasets defined in the "IPTC-NAA Information Interchange Model Version No. 4.1".
since | 0.90 |
---|
$mla_iptc_formats : array
This array contains the file format identifiers and descriptions defined in the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 1#020.
since | 0.90 |
---|
$mla_iptc_image_types : array
This array contains the image type identifiers and descriptions defined in the "IPTC-NAA Information Interchange Model Version No. 4.1" for dataset 2#130, octet 2.
since | 0.90 |
---|
$mla_iptc_records : array
This array contains the identifiers and names of Datasets defined in the "IPTC-NAA Information Interchange Model Version No. 4.1".
since | 0.90 |
---|