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_id3_metadata()
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_id3_metadata_value()
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_query_terms_clauses_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()
_wildcard_search_string()
$mla_iptc_keys
$query_parameters
$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
$wp_4dot0_plus
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 |
---|
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
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_flush_mla_galleries(string $option_name) : void
since | 1.00 |
---|
string
name of the gallery's cache/option variable
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_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 |
---|
string
Complete path and/or name of the template file, option name or the raw template
string
Optional type of template source; 'path', 'file' (default), 'option', 'string'
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_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
Supports prepare_items in class-mla-list-table.php. Modeled after wp_edit_attachments_query in wp-admin/post.php
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_query_media_modal_items(array $request, int $offset, int $count) : object
Supports month-year and taxonomy-term filters as well as the enhanced search box
since | 1.20 |
---|
array
query parameters from Media Manager
int
number of rows to skip over to reach desired page
int
number of rows on each page
object
WP_Query object with query resultsmla_query_posts_clauses_filter(array $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
since | 1.80 |
---|
array
query clauses before modification
array
query 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 |
---|
array
query clauses before modification
array
query 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 |
---|
string
query clause before modification
string
updated query clausemla_query_posts_join_filter(string $join_clause) : string
Defined as public because it's a filter.
since | 0.30 |
---|
string
query clause before modification
string
query 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 |
---|
string
query clause before modification
string
updated query clausemla_query_posts_search_filter(string $search_string, object $query_object) : string
Defined as public because it's a filter.
since | 0.60 |
---|
string
query clause before modification
object
WP_Query object
string
query 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 |
---|
string
query clause before modification
string
query clause after modificationmla_query_relevanssi_admin_search_ok_filter(boolean $admin_search_ok) : boolean
since | 1.80 |
---|
boolean
Default setting
boolean
Updated settingmla_query_terms_clauses_filter(array $pieces, array $taxonomies, array $args)
Defined as public because it's a filter.
since | 2.13 |
---|
array
Terms query SQL clauses.
array
An array of taxonomies.
array
An array of terms query arguments.
mla_save_post_action(integer $post_id) : void
since | 1.00 |
---|
integer
ID 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 |
---|
string
search term before modification
string
cleaned up search termmla_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_build_mla_galleries(string $option_name, array $galleries_array, string $shortcode, boolean $exclude_revisions) : boolean
since | 0.70 |
---|
string
name of the gallery's cache/option variable
array
by reference to the private static galleries array variable
string
the shortcode to be searched for and processed
boolean
true to exclude revisions from the search
boolean
true 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 |
---|
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_execute_list_table_query(array $request) : object
since | 0.30 |
---|
array
query parameters from web page, usually found in $_REQUEST
object
WP_Query object with query results_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 ')'_match_quoted_phrase(string $needle, string $haystack) : boolean
Eliminates matches such as "man" in "woman".
since | 2.11 |
---|
string
the quoted phrase (without enclosing quotes)
string
the entire term
boolean
$needle is a word match within $haystack_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_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 |
---|
array
query parameters from web page, usually found in $_REQUEST
int
Optional number of rows (default 0) to skip over to reach desired page
int
Optional number of rows on each page (0 = all rows, default)
array
revised arguments suitable for WP_Query_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_search_mla_galleries(array $galleries_array, int $attachment_id) : array
since | 0.70 |
---|
array
by reference to the private static galleries array variable
int
the attachment ID to be searched for and processed
array
All 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 |
---|
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_wildcard_search_string(string $search_string) : boolean
Defined as public because it's a callback from array_map().
since | 2.13 |
---|
string
search string
boolean
true if wildcard$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_postmeta_view, 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 |
---|
$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 |
---|
$wp_4dot0_plus : boolean
since | 2.13 |
---|
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 |
---|