initialize()
mla_count_list_table_items()
mla_exif_metadata_value()
mla_fetch_attachment_image_metadata()
mla_fetch_attachment_metadata()
mla_fetch_attachment_parent_data()
mla_fetch_attachment_references()
mla_flush_mla_galleries()
mla_get_attachment_by_id()
mla_get_template_placeholders()
mla_load_template()
mla_parse_template()
mla_query_list_table_items()
mla_query_media_modal_items()
mla_query_posts_join_filter()
mla_query_posts_orderby_filter()
mla_query_posts_search_filter()
mla_query_posts_where_filter()
mla_save_post_action()
mla_update_single_item()
_build_mla_galleries()
_execute_list_table_query()
_hex_dump()
_prepare_list_table_query()
_remove_tags()
_search_mla_galleries()
$galleries
$mla_alt_text_view
$mla_galleries
$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_count_list_table_items(array $request) : integer
since | 0.30 |
---|
array
Query variables, e.g., from $_REQUEST
integer
Number of attachment postsmla_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) : array
since | 0.90 |
---|
string
A formatting string containing [+placeholders+]
array
Placeholder information: each entry is an array with ['prefix'] => string, ['value'] => string, ['single'] => booleanmla_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 name of the template file, option name or the raw template
string
Optional type of template source; '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_template(string $tpl, array $hash) : string
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')
string
Placeholders corresponding to the keys of the hash will be replaced with their valuesmla_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) : array
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
array
attachment objects (posts)mla_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 "detached" item modificationmla_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_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_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_hex_dump(string $data, integer $limit, \intger $bytes_per_row) : string
since | 0.90 |
---|
string
Binary data
integer
Bytes to format, default = 0 (all bytes)
\intger
Bytes to format on each line
string
Printable representation of $data_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_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.$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 array of [gallery] entries numbered from one (1). Each inner array has these elements: ['parent_title'] post_title of the gallery parent, ['parent_type'] 'post' or 'page' or the custom post_type of the gallery parent, ['query'] contains a string with the arguments of the [gallery], ['results'] contains an array of post_ids for the objects in the gallery.
since | 0.70 |
---|
$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 |
---|
$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, detached, orderby, order, s, mla_search_connector, mla_search_fields, sentence, exact
since | 0.30 |
---|
MLA_ALT_TEXT_VIEW_SUFFIX
since | 0.40 |
---|