Class MLA (Media Library Assistant) Query provides database query support for MLA Ajax, Shortcode and Admin needs
| package |
Media Library Assistant |
|---|---|
| since | 2.20 |
_execute_list_table_query( $request) : object
| since | 0.30 |
|---|
objectWP_Query object with query results
_localize_default_columns_array()
| since | 1.71 |
|---|---|
_match_quoted_phrase( $needle, $haystack) : boolean
Eliminates matches such as "man" in "woman".
| since | 2.11 |
|---|
boolean$needle is a word match within $haystack
_parse_terms_search( $whole_string, $delimiter = ',', $full_parse = false) : array
| since | 2.31 |
|---|
arrayindividual arguments, e.g. array( 0 => '"a phrase"', 1 => 'separate', 2 => 'phrase' )
_prepare_list_table_query( $raw_request, $offset, $count) : array
Prepare the arguments for WP_Query. Modeled after wp_edit_attachments_query in wp-admin/post.php
| since | 0.1 |
|---|
arrayrevised arguments suitable for WP_Query
_wildcard_search_string( $search_string) : boolean
Defined as public because it's a callback from array_map().
| since | 2.13 |
|---|
booleantrue if wildcard
initialize()
| since | 0.1 |
|---|---|
mla_count_list_table_items( $request, $offset = NULL, $count = NULL) : integer
| since | 0.30 |
|---|
integerNumber of attachment posts
mla_custom_field_option_value( $slug) : array
| since | 1.10 |
|---|
arrayoption value, e.g., array( 'name' => 'File Size', ... )
mla_flush_mla_galleries( $option_name) : void
| since | 1.00 |
|---|
mla_get_sortable_columns() : array
| since | 0.30 |
|---|---|
arrayname => array( orderby value, heading ) for sortable columns
mla_query_list_table_items( $request, $offset, $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 |
|---|
arrayattachment objects (posts) including parent data, meta data and references
mla_query_media_modal_items( $request, $offset, $count) : object
Supports month-year and taxonomy-term filters as well as the enhanced search box
| since | 1.20 |
|---|
objectWP_Query object with query results
mla_query_posts_clauses_filter( $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
| since | 1.80 |
|---|
arrayquery clauses after modification (none)
mla_query_posts_clauses_request_filter( $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
| since | 1.80 |
|---|
arrayquery clauses after modification (none)
mla_query_posts_groupby_filter( $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 |
|---|
stringupdated query clause
mla_query_posts_join_filter( $join_clause) : string
Defined as public because it's a filter.
| since | 0.30 |
|---|
stringquery clause after "LEFT JOIN view ON post_id" item modification
mla_query_posts_orderby_filter( $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 |
|---|
stringupdated query clause
mla_query_posts_search_filter( $search_string) : string
Defined as public because it's a filter.
| since | 0.60 |
|---|
stringquery clause after keyword search addition
mla_query_posts_where_filter( $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 after modification
mla_query_relevanssi_admin_search_ok_filter( $admin_search_ok) : boolean
| since | 1.80 |
|---|
booleanUpdated setting
mla_query_relevanssi_prevent_default_request_filter( $prevent) : boolean
| since | 2.25 |
|---|
booleanUpdated setting
mla_query_terms_clauses_filter(array $pieces, array $taxonomies, array $args)
Defined as public because it's a filter.
| since | 2.13 |
|---|---|
arrayTerms query SQL clauses.
arrayAn array of taxonomies.
arrayAn array of terms query arguments.
mla_search_terms_tidy( $term) : string
Defined as public because it's a callback from array_map().
| since | 1.51 |
|---|
stringcleaned up search term
MLA_ALT_TEXT_SUBQUERY
The subquery is used to filter the Media/Assistant submenu table by ALT Text with the Search Media text box.
| since | |
|---|---|
MLA_FILE_SUBQUERY
The subquery is used to filter the Media/Assistant submenu table by File Name with the Search Media text box.
| since | |
|---|---|
MLA_ORDERBY_SUBQUERY
The subquery is used to sort the Media/Assistant submenu table on ALT Text and custom field columns.
| since | |
|---|---|
MLA_TABLE_VIEW_SUBQUERY
The SQL View is used to filter the Media/Assistant submenu table on custom field Table Views.
| since | |
|---|---|
wp_4dot0_plus : boolean
| since | |
|---|---|
| var |
boolean
default_columns : array
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.
| since | |
|---|---|
| var |
array
default_hidden_columns : array
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.
| since | |
|---|---|
| var |
array
default_sortable_columns : array
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 MLAQuery::initialize.
| since | |
|---|---|
| var |
array
mla_list_table_items : array
| since | |
|---|---|
| var |
array
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