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 |
_bin_to_utf8( $string) : string
| since | 1.41 |
|---|
stringUTF-8 encoded string
_evaluate_template_array_node( $node, $markup_values = array()) : mixed
Will return an array of values if one or more of the placeholders returns an array.
| since | 1.50 |
|---|
mixedstring or array, depending on placeholder values. Placeholders corresponding to the keys of the markup_values will be replaced with their values.
_evaluate_template_node( $node, $markup_values = array()) : string
| since | 1.50 |
|---|
stringString with expanded values, if any
_find_template_substring( $tpl) : string
| since | 1.50 |
|---|
string'' or template string starting with '[+template:' and ending with the matching '+]'
_find_test_substring( $tpl) : string
| since | 1.50 |
|---|
string'' or template string starting with '(' and ending with the matching ')'
_nonempty_value( &$namespace_array, $namespace, $key) : string
| since | 2.10 |
|---|
stringtrimmed value of the key within the namespace
_parse_arguments( $argument_string) : array
| since | 2.02 |
|---|
arrayindividual arguments, e.g. array( 0 => 'd/m/Y H:i:s', 1 => 'arg, " two' )
_parse_field_level_template( $tpl) : array
| since | 1.50 |
|---|
array( node => array( type => "string | test | choice | template", length => bytes, value => string | node(s) ) )
_parse_iso8601_date( $source_string) : string
| since | 1.50 |
|---|
stringformatted date string YYYY-MM-DD HH:mm:SS
_parse_xmp_array( $values) : mixed
| since | 2.10 |
|---|
mixedSimplified array or string value
_process_field_level_array( $record, $option = 'text', $keep_existing = false) : array
| since | 1.50 |
|---|
array( parameter => value ) for all field-level parameters and anything in $markup_values
_rational_to_decimal( $rational) : float
| since | 1.50 |
|---|
floatnumerator/denominator
_rational_to_string( $rational, $integer_format, $fraction_format, $mixed_format) : mixed
| since | 2.02 |
|---|
mixedformatted value or boolean false if no value available
_remove_terms( $post_id, $terms, $taxonomy_obj) : array
| since | 0.40 |
|---|
arrayTerm ids/names of the surviving terms
_set_array_element( $needle, &$value, &$haystack) : boolean
| since | 1.51 |
|---|
booleantrue if $needle element set, false if not
_unset_array_element( $needle, &$haystack) : boolean
| since | 1.51 |
|---|
booleantrue if $needle element found, false if not
initialize()
| since | 0.1 |
|---|---|
mla_apply_field_level_format( $value, $args) : string
| since | 2.10 |
|---|
stringformatted field-level content
mla_count_list_table_items( $request, $offset = NULL, $count = NULL) : integer
Compatibility shim for MLAQuery::mla_count_list_table_items
| since | 0.30 |
|---|
integerNumber of attachment posts
mla_find_array_element( $needle, $haystack, $option, $keep_existing = false, $glue = ', ') : 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 |
|---|
mixedstring or array value matching key(.key ...) or ''
mla_get_template_placeholders( $tpl, $default_option = 'text') : array
| since | 0.90 |
|---|
arrayPlaceholder information: each entry is an array with ['prefix'] => string, ['value'] => string, ['option'] => string 'text'|single'|'export'|'array'|'multi'
mla_hex_dump( $data, $limit, $bytes_per_row = 16, $offset = -1) : string
| since | 0.90 |
|---|
stringPrintable representation of $data
mla_IPTC_EXIF_error_handler( $type, $string, $file, $line) : boolean
| since | 1.81 |
|---|
booleantrue, to bypass PHP error handler
mla_parse_array_template( $tpl, $markup_values) : mixed
Will return an array of values if one or more of the placeholders returns an array.
| since | 1.50 |
|---|
mixedstring 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( $source_string) : string
| since | 1.50 |
|---|
stringformatted date string YYYY-MM-DD HH:mm:SS
mla_parse_template( $tpl, $markup_values) : \strng
A simple parsing function for basic templating.
| since | 0.1 |
|---|
\strngPlaceholders corresponding to the keys of the markup_values will be replaced with their values.
mla_query_list_table_items( $request, $offset, $count) : array
Compatibility shim for MLAQuery::mla_query_list_table_items
| since | 0.1 |
|---|
arrayattachment objects (posts) including parent data, meta data and references
mla_save_post_action( $post_id) : void
| since | 1.00 |
|---|
mla_update_single_item( $post_id, $new_data, $tax_input = NULL, $tax_actions = NULL) : array
| since | 0.1 |
|---|
arraysuccess/failure message and NULL content
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 | |
|---|---|
| var |
array
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'] => 'title', 'name', 'alt-text', 'excerpt', 'content', 'file' ,'terms' Note: 'alt-text' and 'file' are 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 | |
|---|---|
| var |
array
utf8_chars : array
| since | |
|---|---|
| var |
array
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 | |
|---|---|
| var |
array
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 | |
|---|---|
| var |
array
mla_iptc_descriptions : array
This array contains the descriptions of Datasets defined in the "IPTC-NAA Information Interchange Model Version No. 4.1".
| since | |
|---|---|
| var |
array
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 | |
|---|---|
| var |
array
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 | |
|---|---|
| var |
array
mla_IPTC_EXIF_errors : array
| since | |
|---|---|
| var |
array