\MLAReferences

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

Summary

Methods
Properties
Constants
mla_fetch_attachment_references_handler()
mla_attachment_array_fetch_references_handler()
mla_flush_mla_galleries_handler()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
_build_mla_galleries()
_search_mla_galleries()
$galleries
$mla_galleries
N/A

Properties

$galleries

$galleries : array

Objects containing [gallery] shortcodes

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.

Type

array

$mla_galleries

$mla_galleries : array

Objects containing [mla_gallery] shortcodes

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.

Type

array

Methods

mla_fetch_attachment_references_handler()

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

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

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

Parameters

$ID
$parent
$add_references

Returns

array —

Reference information; see $references array comments

mla_attachment_array_fetch_references_handler()

mla_attachment_array_fetch_references_handler(  $attachments) : void

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

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

Parameters

$attachments

mla_flush_mla_galleries_handler()

mla_flush_mla_galleries_handler(  $option_name) : void

Invalidates the $mla_galleries or $galleries array and cached values

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

Parameters

$option_name

_build_mla_galleries()

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

Builds the $mla_galleries or $galleries array

Parameters

$option_name
$galleries_array
$shortcode
$exclude_revisions

Returns

boolean —

true if the galleries array is not empty

_search_mla_galleries()

_search_mla_galleries(  $galleries_array,   $attachment_id) : array

Search the $mla_galleries or $galleries array

Parameters

$galleries_array
$attachment_id

Returns

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.