# MLAReferences

Class MLA (Media Library Assistant) Query provides database query support for "where-used" reporting needs

package | Media Library Assistant
since | 2.20

### Methods

## Builds the $mla_galleries or $galleries array

    _build_mla_galleries( $option_name,  &$galleries_array,  $shortcode,  $exclude_revisions) : boolean

static

since | 0.70

### Arguments

#### $option_name

``

#### $galleries_array

``

#### $shortcode

``

#### $exclude_revisions

``

### Response

`boolean`

true if the galleries array is not empty

## Search the $mla_galleries or $galleries array

    _search_mla_galleries( &$galleries_array,  $attachment_id) : array

static

since | 0.70

### Arguments

#### $galleries_array

``

#### $attachment_id

``

### Response

`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.

## Add Featured Image and inserted image/link references to an array of attachments

    mla_attachment_array_fetch_references_handler( &$attachments) : void

static

Called from MLAQuery::mla_fetch_attachment_references, which handles conditional loading of this file.

since | 1.94

### Arguments

#### $attachments

``

## Find Featured Image and inserted image/link references to an attachment

    mla_fetch_attachment_references_handler( $ID,  $parent,  $add_references = true) : array

static

Called from MLAQuery::mla_fetch_attachment_references, which handles conditional loading of this file.

since | 0.1

### Arguments

#### $ID

``

#### $parent

``

#### $add_references

``

### Response

`array`

Reference information; see $references array comments

## Invalidates the $mla_galleries or $galleries array and cached values

    mla_flush_mla_galleries_handler( $option_name) : void

static

Called from MLAQuery::mla_flush_mla_galleries, which handles conditional loading of this file.

since | 1.00

### Arguments

#### $option_name

``

### Properties

## Objects containing [gallery] shortcodes

    galleries : array

static

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 associative array with: ['parent_title'] post_title of the gallery parent, ['parent_type'] 'post' or 'page' or the custom post_type of the gallery parent, ['parent_status'] 'publish', 'private', 'future', 'pending', 'draft' ['results'] array ( ID => ID ) of attachments appearing in ANY of the parent's galleries. ['galleries'] array of [gallery] entries numbered from one (1), containing: galleries[X]['query'] contains a string with the arguments of the [gallery], galleries[X]['results'] contains an array ( ID ) of post_ids for the objects in the gallery.

since |
var |

### Type(s)

`array`

## Objects containing [mla_gallery] shortcodes

    mla_galleries : array

static

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 |
var |

### Type(s)

`array`