initialize()
mla_attachment_list_shortcode()
mla_gallery_shortcode()
mla_get_shortcode_attachments()
mla_get_terms()
mla_no_texturize_shortcodes_filter()
mla_shortcode_query_posts_clauses_filter()
mla_shortcode_query_posts_clauses_request_filter()
mla_shortcode_query_posts_join_filter()
mla_shortcode_query_posts_orderby_filter()
mla_shortcode_query_posts_where_filter()
mla_tag_cloud()
mla_tag_cloud_shortcode()
_pad_term_counts()
_paginate_links()
_process_pagination_output_types()
_process_shortcode_parameter()
_registered_dimensions()
_sanitize_query_specification()
_validate_sql_orderby()
$mla_debug_messages
$mla_gallery_wp_query_object
$mla_debug
$mla_get_shortcode_attachments_parameters
$mla_get_terms_parameters
$query_parameters
Class MLA (Media Library Assistant) Shortcodes defines the shortcodes available to MLA users
package | Media Library Assistant |
---|---|
since | 0.20 |
initialize() : void
since | 0.20 |
---|
mla_gallery_shortcode(array $attr, string $content) : string
This is a superset of the WordPress Gallery shortcode for displaying images on a post, page or custom post type. It is adapted from /wp-includes/media.php gallery_shortcode. Enhancements include many additional selection parameters and full taxonomy support.
since | .50 |
---|
array
Attributes of the shortcode
string
Optional content for enclosing shortcodes; used with mla_alt_shortcode
string
HTML content to display gallery.mla_get_terms(array $attr) : array
Alternative to WordPress /wp-includes/taxonomy.php function get_terms() that provides an accurate count of attachments associated with each term.
taxonomy - string containing one or more (comma-delimited) taxonomy names or an array of taxonomy names. Default 'post_tag'.
post_mime_type - MIME type(s) of the items to include in the term-specific counts. Default 'all'.
post_type - The post type(s) of the items to include in the term-specific counts. The default is "attachment".
post_status - The post status value(s) of the items to include in the term-specific counts. The default is "inherit".
ids - A comma-separated list of attachment ID values for an item-specific cloud.
include - An array, comma- or space-delimited string of term ids to include in the return array.
exclude - An array, comma- or space-delimited string of term ids to exclude from the return array. If 'include' is non-empty, 'exclude' is ignored.
parent - term_id of the terms' immediate parent; 0 for top-level terms.
minimum - minimum number of attachments a term must have to be included. Default 0.
no_count - 'true', 'false' (default) to suppress term-specific attachment-counting process.
number - maximum number of term objects to return. Terms are ordered by count, descending and then by term_id before this value is applied. Default 0.
orderby - 'count', 'id', 'name' (default), 'none', 'random', 'slug'
order - 'ASC' (default), 'DESC'
no_orderby - 'true', 'false' (default) to suppress ALL sorting clauses else false.
preserve_case - 'true', 'false' (default) to make orderby case-sensitive.
pad_counts - 'true', 'false' (default) to to include the count of all children in their parents' count.
limit - final number of term objects to return, for pagination. Default 0.
offset - number of term objects to skip, for pagination. Default 0.
since | 1.60 |
---|
array
taxonomies to search and query parameters
array
array of term objects, empty if none foundmla_no_texturize_shortcodes_filter(array $no_texturize_shortcodes) : array
Defined as public because it's a filter.
since | 1.94 |
---|
array
list of "do not texturize" shortcodes
array
updated list of "do not texturize" shortcodesmla_shortcode_query_posts_clauses_filter(array $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
since | 1.30 |
---|
array
query clauses before modification
array
query clauses after modification (none)mla_shortcode_query_posts_clauses_request_filter(array $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
since | 1.30 |
---|
array
query clauses before modification
array
query clauses after modification (none)mla_shortcode_query_posts_join_filter(string $join_clause) : string
Defined as public because it's a filter.
since | 1.90 |
---|
string
query clause before modification
string
query clause after item modificationmla_shortcode_query_posts_orderby_filter(string $orderby_clause) : string
This is an enhanced version of the code found in wp-includes/query.php, function get_posts. Defined as public because it's a filter.
since | 1.20 |
---|
string
query clause before modification
string
query clause after modificationmla_shortcode_query_posts_where_filter(string $where_clause) : string
Captures debug information. Adds whitespace to the post_type = 'attachment' phrase to circumvent subsequent Role Scoper modification of the clause. Handles post_parent "any" and "none" cases. Defined as public because it's a filter.
since | 0.70 |
---|
string
query clause before modification
string
query clause after modificationmla_tag_cloud(array $attr) : string
This is an alternative to the WordPress wp_tag_cloud function, with additional options to customize the hyperlink behind each term.
since | 1.60 |
---|
array
Attributes of the shortcode.
string
HTML content to display the tag cloud.mla_tag_cloud_shortcode(array $attr) : string
This is an interface to the mla_tag_cloud function.
since | 1.60 |
---|
array
Attributes of the shortcode.
string
HTML content to display the tag cloud._pad_term_counts(array $terms, string $taxonomy, array $post_types, array $post_stati) : null
Recalculates term counts by including items from child terms. Assumes all relevant children are already in the $terms argument.
since | 1.90 |
---|
array
Array of Term objects, by reference
string
Term Context
array
Qualifying post type value(s)
array
Qualifying post status value(s)
null
Will break from function if conditions are not met._paginate_links(array $output_parameters, string $markup_values, string $arguments, integer $found_rows, string $output) : mixed
since | 1.42 |
---|
array
value(s) for mla_output_type parameter
string
template substitution values, e.g., ('instance' => '1', ... )
string
merged default and passed shortcode parameter values
integer
number of attachments in the gallery, without pagination
string
output text so far, may include debug values
mixed
false or string with HTML for pagination output types_process_pagination_output_types(array $output_parameters, string $markup_values, string $arguments, string $attr, integer $found_rows, string $output) : mixed
since | 1.42 |
---|
array
value(s) for mla_output_type parameter
string
template substitution values, e.g., ('instance' => '1', ... )
string
merged default and passed shortcode parameter values
string
raw passed shortcode parameter values
integer
number of attachments in the gallery, without pagination
string
output text so far, may include debug values
mixed
false or string with HTML for pagination output types_process_shortcode_parameter(string $text, string $markup_values) : string
since | 1.14 |
---|
string
raw shortcode parameter, e.g., "text {+field+} {brackets} \{braces\}"
string
template substitution values, e.g., ('instance' => '1', ... )
string
parameter with brackets, braces, substitution parameters and templates processed_registered_dimensions() : array
since | 1.82 |
---|
array
_sanitize_query_specification(string $specification) : string
since | 1.14 |
---|
string
query specification; PHP nested arrays
string
query specification with HTML escape sequences and line breaks removed_validate_sql_orderby(array $query_parameters, string $table_prefix, array $allowed_keys, array $binary_keys) : string | bool
Accepts one or more valid columns, with or without ASC/DESC. Enhanced version of /wp-includes/formatting.php function sanitize_sql_orderby().
since | 1.20 |
---|
array
Validated query parameters; 'order', 'orderby', 'meta_key', 'post__in'.
string
Optional. Database table prefix; can be empty. Default taken from $wpdb->posts.
array
Optional. Field names (keys) and database column equivalents (values). Defaults from [mla_gallery].
array
Optional. Field names (values) that require a BINARY prefix to preserve case order. Default array()
string
bool
Returns the orderby clause if present, false otherwise.$mla_gallery_wp_query_object : object
Defined as a public, static variable so it can be inspected from the "mla_gallery_wp_query_object" action. Set to NULL at all other times.
since | 1.51 |
---|
$mla_debug : boolean
since | 0.70 |
---|
$mla_get_terms_parameters : array
since | 1.60 |
---|
$query_parameters : array
This array defines parameters for the query's join, where and orderby filters. The parameters are set up in the mla_get_shortcode_attachments function, and any further logic required to translate those values is contained in the filter.
Array index values are: orderby, post_parent
since | 1.13 |
---|