\MLATemplate_Support

Class MLA (Media Library Assistant) Custom Style/Markup Template Support provides functions that define, import and export custom style and markup templates for MLA shortcodes.

Summary

Methods
Properties
Constants
mla_localize_template_definitions()
mla_load_custom_templates()
mla_fetch_custom_template()
mla_get_style_templates()
mla_put_style_templates()
mla_get_markup_templates()
mla_put_markup_templates()
$mla_template_definitions
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$mla_custom_templates
N/A

Properties

$mla_template_definitions

$mla_template_definitions : 

$mla_template_definitions defines the structure of the style and markup templates and the labels, etc. required to render them in the Settings/Shortcodes tab

The array must be populated at runtime in MLATemplate_Support::mla_localize_template_definitions(); localization calls cannot be placed in the "public static" array definition itself.

Template types are indexed by 'style'/'markup' and then shortcode name. Each template type is defined by: 'slug' => Sanitized version of the shortcode name 'default_names' => Names of the default templates 'label' => Styles only; label for the template textbox 'help' => Styles only; help text displayed below the textbox 'sections' => Markup only; array of template section definitions 'sections'[] elements: 'label' => Label for the section textbox 'help' => Help text displayed below the textbox 'order' => Where the section appears in the template

Type

$mla_custom_templates

$mla_custom_templates : array

Style and Markup templates

Templates are indexed by 'style'/'markup' and then shortcode name. Each template type is defined by:

Type

array

Methods

mla_localize_template_definitions()

mla_localize_template_definitions() : void

Localize $mla_option_definitions array

Localization must be done at runtime; these calls cannot be placed in the "public static" array definition itself. Called from MLATest::initialize.

mla_load_custom_templates()

mla_load_custom_templates() : void

Load style and markup templates to $mla_custom_templates

mla_fetch_custom_template()

mla_fetch_custom_template(  $key,   $shortcode = 'gallery',   $type = 'style',   $section = '[not supplied]') : string|boolean|null

Fetch style or markup template from $mla_templates

Parameters

$key
$shortcode
$type
$section

Returns

string|boolean|null —

requested template, false if not found or null if no templates

mla_get_style_templates()

mla_get_style_templates(  $shortcode = '') : array|null

Get ALL style templates from $mla_custom_templates, including 'default'

Parameters

$shortcode

Returns

array|null —

name => value for all style templates or null if no templates

mla_put_style_templates()

mla_put_style_templates(  $templates) : boolean

Put user-defined style templates to $mla_custom_templates and database

Parameters

$templates

Returns

boolean —

true if success, false if failure

mla_get_markup_templates()

mla_get_markup_templates(  $shortcode = '') : array|null

Get ALL markup templates from $mla_custom_templates, including 'default'

Parameters

$shortcode

Returns

array|null —

name => value for all markup templates or null if no templates

mla_put_markup_templates()

mla_put_markup_templates(  $templates) : boolean

Put user-defined markup templates to $mla_custom_templates and database

Parameters

$templates

Returns

boolean —

true if success, false if failure