Class MLA (Media Library Assistant) Shortcode Support provides the functions that implement the [mla_gallery] and [mla_tag_cloud] shortcodes. It also implements the mla_get_shortcode_attachments() and mla_get_terms() database access functions.
| package |
Media Library Assistant |
|---|---|
| since | 2.20 |
_compose_term_list(string &$list, array &$links, array &$terms, array &$markup_values, array &$arguments, array &$attr) : void
Adds shortcode output text and term-specific links to arrays passed by reference.
| since | 2.25 |
|---|
stringShortcode output text, by reference
arrayTerm-specific links for flat/array output, by reference
arrayTerm objects, by reference
arrayStyle and list-level substitution parameters, by reference
arrayShortcode parameters, including defaults, by reference
arrayShortcode parameters, explicit, by reference
_count_term_children(object &$parent, integer $depth) : integer
Recalculates term counts by including items from child terms. Assumes all relevant children are already in the $terms argument.
| since | 2.25 |
|---|
objectParent Term objects, by reference
integerMaximum depth of parent/child relationship
integerTotal number of children, all levels
_find_child_of(array &$parents, integer $parent_id) : mixed
| since | 2.25 |
|---|
arrayPotential parent Term objects, by reference
integerTerm_id of the desired parent
mixedTerm object of the desired parent else false
_find_include_tree(array &$terms, array $include_tree) : mixed
| since | 2.25 |
|---|
arrayPotential term objects, by reference
arrayterm_id(s) of the desired terms
mixedTerm object(s) of the desired terms else false
_get_term_tree(array &$terms, array $arguments = array()) : array
| since | 2.25 |
|---|
arrayTerm objects, by reference
arrayShortcode arguments, including defaults
array( [taxonomy] => array( [root terms] => array( [fields], array( 'children' => [child terms] )
_pad_term_counts( &$terms, $taxonomy, $post_types = NULL, $post_stati = NULL) : null
Recalculates term counts by including items from child terms. Assumes all relevant children are already in the $terms argument.
| since | 2.20 |
|---|
nullWill break from function if conditions are not met.
_paginate_links( $output_parameters, $markup_values, $arguments, $found_rows, $output = '') : mixed
| since | 2.20 |
|---|
mixedfalse or string with HTML for pagination output types
_process_pagination_output_types( $output_parameters, $markup_values, $arguments, $attr, $found_rows, $output = '') : mixed
| since | 2.20 |
|---|
mixedfalse or string with HTML for pagination output types
_process_shortcode_parameter( $text, $markup_values) : string
| since | 2.20 |
|---|
stringparameter with brackets, braces, substitution parameters and templates processed
_registered_dimensions() : array
| since | 2.20 |
|---|---|
array
_remove_exclude_tree(array &$terms, array $exclude_tree) : void
| since | 2.25 |
|---|
arrayPotential term objects, by reference
arrayterm_id(s) of the desired terms
_sanitize_query_specification( $specification) : string
| since | 2.20 |
|---|
stringquery specification with HTML escape sequences and line breaks removed
_validate_attributes(mixed $attr, string $content = NULL) : array
| since | 2.20 |
|---|
mixedArray or string containing shortcode attributes
stringOptional content for enclosing shortcodes
arrayclean attributes array
_validate_sql_orderby( $query_parameters, $table_prefix = NULL, $allowed_keys = NULL, $binary_keys = array()) : string|boolean
Accepts one or more valid columns, with or without ASC/DESC. Enhanced version of /wp-includes/formatting.php function sanitize_sql_orderby().
| since | 2.20 |
|---|
string|booleanReturns the orderby clause if present, false otherwise.
mla_gallery_shortcode(array $attr, string $content = NULL) : 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 | 2.20 |
|---|
arrayAttributes of the shortcode
stringOptional content for enclosing shortcodes
stringHTML content to display gallery.
mla_get_terms( $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.
fields - string with fields for the SQL SELECT clause, e.g.,
't.term_id, t.name, t.slug, COUNT(p.ID) AS count'
| since | 2.20 |
|---|
arrayarray of term objects, empty if none found
mla_ghostscript_present( $explicit_path = '', $ghostscript_only = false) : boolean
| since | 2.20 |
|---|
booleantrue if Ghostscript available else false
mla_shortcode_query_posts_clauses_filter( $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
| since | 2.20 |
|---|
arrayquery clauses after modification (none)
mla_shortcode_query_posts_clauses_request_filter( $pieces) : array
This is for debug purposes only. Defined as public because it's a filter.
| since | 2.20 |
|---|
arrayquery clauses after modification (none)
mla_shortcode_query_posts_join_filter( $join_clause) : string
Defined as public because it's a filter.
| since | 2.20 |
|---|
stringquery clause after item modification
mla_shortcode_query_posts_orderby_filter( $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 | 2.20 |
|---|
stringquery clause after modification
mla_shortcode_query_posts_where_filter( $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 | 2.20 |
|---|
stringquery clause after modification
mla_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 | 2.20 |
|---|
arrayAttributes of the shortcode.
stringHTML content to display the tag cloud.
mla_tag_cloud_shortcode(array $attr, string $content = NULL) : string
This is an interface to the mla_tag_cloud function.
| since | 2.20 |
|---|
arrayAttributes of the shortcode.
stringOptional content for enclosing shortcodes
stringHTML content to display the tag cloud.
mla_term_list(array $attr) : string
This is an alternative to the WordPress wp_list_categories, wp_dropdown_categories and wp_terms_checklist functions, with additional options to customize the hyperlink behind each term.
| since | 2.25 |
|---|
arrayAttributes of the shortcode.
stringHTML content to display the term list, dropdown control or checklist.
mla_term_list_shortcode(array $attr, string $content = NULL) : string
This is an interface to the mla_term_list function.
| since | 2.25 |
|---|
arrayAttributes of the shortcode.
stringOptional content for enclosing shortcodes
stringHTML content to display the term list.
mla_debug : boolean
| since | |
|---|---|
| var |
boolean
empty_post : array
| since | |
|---|---|
| var |
array
term_list_item_specific_arguments : 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 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 | |
|---|---|
| var |
array
mla_get_terms_parameters : array
| since | |
|---|---|
| var |
array