MLA_ALT_TEXT_SUBQUERY
MLA_ALT_TEXT_SUBQUERY
Provides a unique value for the ALT Text "Search Media" subquery
The subquery is used to filter the Media/Assistant submenu table by ALT Text with the Search Media text box.
Class MLA (Media Library Assistant) Query provides database query support for MLA Ajax, Shortcode and Admin needs
$default_columns : array
Table column definitions
This array defines table columns and titles where the key is the column slug (and class) and the value is the column's title text. If you need a checkbox for bulk actions, use the special slug "cb".
The 'cb' column is treated differently than the rest. If including a checkbox column in your table you must create a column_cb() method. If you don't need bulk actions or checkboxes, simply leave the 'cb' entry out of your array.
All of the columns are added to this array by MLA_List_Table::mla_admin_init_action.
$default_hidden_columns : array
Default values for hidden columns
This array is used when the user-level option is not set, i.e., the user has not altered the selection of hidden columns.
The value on the right-hand side must match the column slug, e.g., array(0 => 'ID_parent, 1 => 'title_name').
Taxonomy and custom field columns are added to this array by MLA_List_Table::mla_admin_init_action.
$default_sortable_columns : array
Sortable column definitions
This array defines the table columns that can be sorted. The array key is the column slug that needs to be sortable, and the value is database column to sort by. Often, the key and value will be the same, but this is not always the case (as the value is a column name from the database, not the list table).
The array value also contains a boolean which is 'true' if the initial sort order for the column is DESC/Descending.
Taxonomy and custom field columns are added to this array by MLA_List_Table::mla_admin_init_action.
$query_parameters : array
WP_Query filter "parameters"
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)
$search_parameters : array
WP_Query 'posts_search' filter "parameters"
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
mla_fetch_attachment_references( $ID, $parent, $add_references = true) : array
Find Featured Image and inserted image/link references to an attachment
Searches all post and page content to see if the attachment is used as a Featured Image or inserted in the post as an image or link.
$ID | ||
$parent | ||
$add_references |
Reference information; see $references array comments
mla_attachment_array_fetch_references( $attachments) : void
Add Featured Image and inserted image/link references to an array of attachments
Searches all post and page content to see if the attachmenta are used as a Featured Image or inserted in the post as an image or link.
$attachments |
mla_query_list_table_items( $request, $offset, $count) : array
Retrieve attachment objects for list table display
Supports prepare_items in class-mla-list-table.php. Modeled after wp_edit_attachments_query in wp-admin/post.php
$request | ||
$offset | ||
$count |
attachment objects (posts) including parent data, meta data and references
mla_query_media_modal_items( $request, $offset, $count) : object
Retrieve attachment objects for the WordPress Media Manager
Supports month-year and taxonomy-term filters as well as the enhanced search box
$request | ||
$offset | ||
$count |
WP_Query object with query results
mla_fetch_attachment_metadata( $post_id) : array
Fetch and filter meta data for an attachment
Returns a filtered array of a post's meta data. Internal values beginning with '' are stripped out or converted to an 'mla' equivalent.
$post_id |
Meta data variables
mla_query_posts_where_filter( $where_clause) : string
Adds/modifies the WHERE clause for meta values, LIKE patterns and detached items
Modeled after _edit_attachments_query_helper in wp-admin/post.php. Defined as public because it's a filter.
$where_clause |
query clause after modification
mla_query_posts_join_filter( $join_clause) : string
Adds a JOIN clause, if required, to handle sorting/searching on custom fields or ALT Text
Defined as public because it's a filter.
$join_clause |
query clause after "LEFT JOIN view ON post_id" item modification
mla_query_posts_groupby_filter( $groupby_clause) : string
Adds a GROUPBY clause, if required
Taxonomy text queries and postmeta queries can return multiple results for the same ID. Defined as public because it's a filter.
$groupby_clause |
updated query clause
mla_query_posts_orderby_filter( $orderby_clause) : string
Adds a ORDERBY clause, if required
Expands the range of sort options because the logic in WP_Query is limited. Defined as public because it's a filter.
$orderby_clause |
updated query clause
mla_query_terms_clauses_filter(array $pieces, array $taxonomies, array $args)
Filters all clauses for get_terms queries
Defined as public because it's a filter.
array | $pieces | Terms query SQL clauses. |
array | $taxonomies | An array of taxonomies. |
array | $args | An array of terms query arguments. |
mla_query_posts_clauses_request_filter( $pieces) : array
Filters all clauses for shortcode queries, post caching plugins
This is for debug purposes only. Defined as public because it's a filter.
$pieces |
query clauses after modification (none)
_prepare_list_table_query( $raw_request, $offset, $count) : array
Sanitize and expand query arguments from request variables
Prepare the arguments for WP_Query. Modeled after wp_edit_attachments_query in wp-admin/post.php
$raw_request | ||
$offset | ||
$count |
revised arguments suitable for WP_Query
_parse_terms_search( $whole_string, $delimiter = ',', $full_parse = false) : array
Process a terms search term or phrase list with quoted phrases and variable delimiters
$whole_string | ||
$delimiter | ||
$full_parse |
individual arguments, e.g. array( 0 => '"a phrase"', 1 => 'separate', 2 => 'phrase' )