initialize()
mla_IPTC_EXIF_error_handler()
mla_apply_field_level_format()
mla_attachment_array_fetch_references()
mla_count_list_table_items()
mla_exif_metadata_value()
mla_expand_field_level_parameters()
mla_fetch_attachment_image_metadata()
mla_fetch_attachment_metadata()
mla_fetch_attachment_parent_data()
mla_fetch_attachment_references()
mla_find_array_element()
mla_flush_mla_galleries()
mla_get_attachment_by_id()
mla_get_template_placeholders()
mla_hex_dump()
mla_iptc_metadata_value()
mla_load_template()
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_query_media_modal_items()
mla_query_posts_clauses_filter()
mla_query_posts_clauses_request_filter()
mla_query_posts_groupby_filter()
mla_query_posts_join_filter()
mla_query_posts_orderby_filter()
mla_query_posts_search_filter()
mla_query_posts_where_filter()
mla_query_relevanssi_admin_search_ok_filter()
mla_save_post_action()
mla_search_terms_tidy()
mla_update_item_postmeta()
mla_update_single_item()
mla_update_wp_attachment_metadata()
mla_xmp_metadata_value()
_bin_to_utf8()
_build_mla_galleries()
_evaluate_template_array_node()
_evaluate_template_node()
_execute_list_table_query()
_expand_field_level_template()
_find_template_substring()
_find_test_substring()
_match_quoted_phrase()
_parse_arguments()
_parse_field_level_template()
_parse_iso8601_date()
_parse_xmp_array()
_prepare_list_table_query()
_process_field_level_array()
_rational_to_decimal()
_rational_to_string()
_remove_terms()
_search_mla_galleries()
_set_array_element()
_unset_array_element()
$mla_iptc_keys
$search_parameters
$utf8_chars
$galleries
$mla_IPTC_EXIF_errors
$mla_alt_text_view
$mla_galleries
$mla_iptc_descriptions
$mla_iptc_formats
$mla_iptc_image_types
$mla_iptc_records
$mla_list_table_items
$query_parameters
MLA_ALT_TEXT_VIEW_SUFFIX
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 |
|---|
intthe level of the error raised
stringthe error message
stringthe filename that the error was raised in
intthe line number the error was raised at
booleantrue, to bypass PHP error handlermla_apply_field_level_format(string $value, array $args) : string
| since | 2.10 |
|---|
stringfield-level content
arrayformat code and aguments
stringformatted field-level contentmla_count_list_table_items(array $request, int $offset, int $count) : integer
| since | 0.30 |
|---|
arrayQuery 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
integerNumber 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. Could also be used with the ID3 metadata exposed in WordPress 3.6 and later.
| since | 1.30 |
|---|
stringkey value, e.g. array1.array2.element
arrayPHP nested arrays
stringdata option 'text'|'single'|'export'|'array'|'multi'
booleankeep existing values - for 'multi' option
mixedstring or array value matching key(.key ...) or ''mla_flush_mla_galleries(string $option_name) : void
| since | 1.00 |
|---|
stringname of the gallery's cache/option variable
mla_get_template_placeholders(string $tpl, string $default_option) : array
| since | 0.90 |
|---|
stringA formatting string containing [+placeholders+]
stringOptional: default option value
arrayPlaceholder 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 |
|---|
stringBinary data
integerBytes to format, default = 0 (all bytes)
\intgerBytes to format on each line
integeroffset of initial byte, or -1 to suppress printing offset information
stringPrintable representation of $datamla_load_template(string $source, string $type) : string | array | false | NULL
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 |
|---|
stringComplete path and/or name of the template file, option name or the raw template
stringOptional type of template source; 'path', 'file' (default), 'option', 'string'
stringarrayfalseNULLstring 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_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 |
|---|
stringA formatting string containing [+placeholders+]
arrayAn associative array containing keys and values e.g. array('key' => 'value')
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(string $source_string) : string
| since | 1.50 |
|---|
stringPDF date string of the form D:YYYYMMDDHHmmSSOHH'mm
stringformatted 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 |
|---|
stringA formatting string containing [+placeholders+]
arrayAn associative array containing keys and values e.g. array('key' => 'value')
\strngPlaceholders 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
Supports prepare_items in class-mla-list-table.php. Modeled after wp_edit_attachments_query in wp-admin/post.php
| since | 0.1 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intnumber of rows to skip over to reach desired page
intnumber of rows on each page
arrayattachment objects (posts) including parent data, meta data and referencesmla_query_media_modal_items(array $request, int $offset, int $count) : array
Supports month-year and taxonomy-term filters as well as the enhanced search box
| since | 1.20 |
|---|
arrayquery parameters from Media Manager
intnumber of rows to skip over to reach desired page
intnumber of rows on each page
arrayattachment objects (posts)mla_query_posts_clauses_filter(array $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
| since | 1.80 |
|---|
arrayquery clauses before modification
arrayquery clauses after modification (none)mla_query_posts_clauses_request_filter(array $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
| since | 1.80 |
|---|
arrayquery clauses before modification
arrayquery clauses after modification (none)mla_query_posts_groupby_filter(string $groupby_clause) : string
Taxonomy text queries and postmeta queries can return multiple results for the same ID. Defined as public because it's a filter.
| since | 1.90 |
|---|
stringquery clause before modification
stringupdated query clausemla_query_posts_join_filter(string $join_clause) : string
Defined as public because it's a filter.
| since | 0.30 |
|---|
stringquery clause before modification
stringquery clause after "LEFT JOIN view ON post_id" item modificationmla_query_posts_orderby_filter(string $orderby_clause) : string
Expands the range of sort options because the logic in WP_Query is limited. Defined as public because it's a filter.
| since | 0.30 |
|---|
stringquery clause before modification
stringupdated query clausemla_query_posts_search_filter(string $search_string, object $query_object) : string
Defined as public because it's a filter.
| since | 0.60 |
|---|
stringquery clause before modification
objectWP_Query object
stringquery clause after keyword search additionmla_query_posts_where_filter(string $where_clause) : string
Modeled after _edit_attachments_query_helper in wp-admin/post.php. Defined as public because it's a filter.
| since | 0.1 |
|---|
stringquery clause before modification
stringquery clause after modificationmla_query_relevanssi_admin_search_ok_filter(boolean $admin_search_ok) : boolean
| since | 1.80 |
|---|
booleanDefault setting
booleanUpdated settingmla_save_post_action(integer $post_id) : void
| since | 1.00 |
|---|
integerID of post/page/attachment; not used at this time
mla_search_terms_tidy(string $term) : string
Defined as public because it's a callback from array_map().
| since | 1.51 |
|---|
stringsearch term before modification
stringcleaned up search termmla_update_single_item(int $post_id, array $new_data, array $tax_input, array $tax_actions) : array
| since | 0.1 |
|---|
intThe ID of the attachment to be updated
arrayField name => value pairs
arrayOptional taxonomy term values, default null
arrayOptional taxonomy actions (add, remove, replace), default null
arraysuccess/failure message and NULL content_bin_to_utf8(string $string) : string
| since | 1.41 |
|---|
stringunencoded string
stringUTF-8 encoded string_build_mla_galleries(string $option_name, array $galleries_array, string $shortcode, boolean $exclude_revisions) : boolean
| since | 0.70 |
|---|
stringname of the gallery's cache/option variable
arrayby reference to the private static galleries array variable
stringthe shortcode to be searched for and processed
booleantrue to exclude revisions from the search
booleantrue if the galleries array is not empty_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 |
|---|
arrayA field-level template element node
arrayAn array of markup substitution values
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(array $node, array $markup_values) : string
| since | 1.50 |
|---|
arrayA field-level template element node
arrayAn array of markup substitution values
stringString with expanded values, if any_execute_list_table_query(array $request) : object
| since | 0.30 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
objectWP_Query object with query results_find_template_substring(string $tpl) : string
| since | 1.50 |
|---|
stringA 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 |
|---|
stringA string possibly starting with '('
string'' or template string starting with '(' and ending with the matching ')'_match_quoted_phrase(string $needle, string $haystack) : boolean
Eliminates matches such as "man" in "woman".
| since | 2.11 |
|---|
stringthe quoted phrase (without enclosing quotes)
stringthe entire term
boolean$needle is a word match within $haystack_parse_arguments(string $argument_string) : array
| since | 2.02 |
|---|
stringarguments, e.g., ('d/m/Y H:i:s' , "arg, \" two" ) without parens
arrayindividual arguments, e.g. array( 0 => 'd/m/Y H:i:s', 1 => 'arg, \" two' )_parse_field_level_template(string $tpl) : array
| since | 1.50 |
|---|
stringTemplate 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 |
|---|
stringISO string of the form YYYY-MM-DDTHH:MM:SS-HH:MM (inc time zone)
stringformatted date string YYYY-MM-DD HH:mm:SS_parse_xmp_array(array $values) : mixed
| since | 2.10 |
|---|
arrayXMP multi-valued element
mixedSimplified array or string value_prepare_list_table_query(array $raw_request, int $offset, int $count) : array
Prepare the arguments for WP_Query. Modeled after wp_edit_attachments_query in wp-admin/post.php
| since | 0.1 |
|---|
arrayquery parameters from web page, usually found in $_REQUEST
intOptional number of rows (default 0) to skip over to reach desired page
intOptional number of rows on each page (0 = all rows, default)
arrayrevised arguments suitable for WP_Query_process_field_level_array(array $record, string $option, boolean $keep_existing) : array
| since | 1.50 |
|---|
arrayan array of scalar values
stringdata option 'text'|'single'|'export'|'array'|'multi'
booleanOptional: 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 |
|---|
arrayarray( 0 => numerator, 1 => denominator )
floatnumerator/denominator_rational_to_string(string $rational, string $integer_format, string $fraction_format, string $mixed_format) : mixed
| since | 2.02 |
|---|
stringnumerator/denominator
stringformat for integer values
stringformat for fractional values from -1 to +1
stringformat for integer.fraction values
mixedformatted value or boolean false if no value available_remove_terms(integer $post_id, array $terms, object $taxonomy_obj) : array
| since | 0.40 |
|---|
integerThe ID of the attachment to be updated
arrayThe term ids (integer array) or names (string array) to remove
objectThe taxonomy object
arrayTerm ids/names of the surviving terms_search_mla_galleries(array $galleries_array, int $attachment_id) : array
| since | 0.70 |
|---|
arrayby reference to the private static galleries array variable
intthe attachment ID to be searched for and processed
arrayAll posts/pages with one or more galleries that include the attachment. The array key is the parent_post ID; each entry contains post_title and post_type._set_array_element(string $needle, mixed $value, array $haystack) : boolean
| since | 1.51 |
|---|
stringkey value, e.g. array1.array2.element
mixedreplacement value, string or array, by reference
arrayPHP nested arrays, by reference
booleantrue if $needle element set, false if not_unset_array_element(string $needle, array $haystack) : boolean
| since | 1.51 |
|---|
stringkey value, e.g. array1.array2.element
arrayPHP nested arrays, by reference
booleantrue 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 |
|---|
$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 ['mla_debug_messages'] => internal element, added when debug = 'shortcode' ['tax_terms_count'] => internal element, shared with JOIN and GROUP BY filters
| since | 2.00 |
|---|
$utf8_chars : array
| since | 1.41 |
|---|
$galleries : array
This array contains all of the objects containing one or more [gallery] shortcodes and array(s) of which attachments each [gallery] contains. The arrays are built once each page load and cached for subsequent calls.
The outer array is keyed by post_id. It contains an associative array with: ['parent_title'] post_title of the gallery parent, ['parent_type'] 'post' or 'page' or the custom post_type of the gallery parent, ['parent_status'] 'publish', 'private', 'future', 'pending', 'draft' ['results'] array ( ID => ID ) of attachments appearing in ANY of the parent's galleries. ['galleries'] array of [gallery] entries numbered from one (1), containing: galleries[X]['query'] contains a string with the arguments of the [gallery], galleries[X]['results'] contains an array ( ID ) of post_ids for the objects in the gallery.
| since | 0.70 |
|---|
$mla_IPTC_EXIF_errors : array
| since | 1.81 |
|---|
$mla_alt_text_view : array
| since | 0.40 |
|---|
$mla_galleries : array
This array contains all of the objects containing one or more [mla_gallery] shortcodes and array(s) of which attachments each [mla_gallery] contains. The arrays are built once each page load and cached for subsequent calls.
| since | 0.70 |
|---|
$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 |
|---|
$mla_list_table_items : array
| since | 1.40 |
|---|
$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_postmeta_view, postmeta_key, postmeta_value, patterns, detached, orderby, order, mla-metavalue, debug (also in search_parameters)
| since | 0.30 |
|---|
MLA_ALT_TEXT_VIEW_SUFFIX
The SQL View is used to sort the Media/Assistant submenu table on ALT Text and custom field columns.
| since | 0.40 |
|---|