mla_fetch_custom_template()
mla_get_markup_templates()
mla_get_style_templates()
mla_load_custom_templates()
mla_localize_template_definitions()
mla_put_markup_templates()
mla_put_style_templates()
$mla_template_definitions
$mla_custom_templates
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.
package | Media Library Assistant |
---|---|
since | 2.30 |
mla_fetch_custom_template(string $key, string $shortcode, string $type, string $section) : string | boolean | null
since | 2.30 |
---|
string
Template name
string
Shortcode slug; 'gallery' (default), 'tag-cloud' or 'term-list'
string
Template type; 'style' (default) or 'markup'
string
Template section (markup templates); default '[not supplied]'
string
boolean
null
requested template, false if not found or null if no templatesmla_get_markup_templates(string $shortcode) : array | null
since | 2.30 |
---|
string
Shortcode to which the template(s) apply; default 'gallery'
array
null
name => value for all markup templates or null if no templatesmla_get_style_templates(string $shortcode) : array | null
since | 2.30 |
---|
string
Shortcode to which the template(s) apply; default ''
array
null
name => value for all style templates or null if no templatesmla_load_custom_templates() : void
since | 2.30 |
---|
mla_localize_template_definitions() : void
Localization must be done at runtime; these calls cannot be placed in the "public static" array definition itself. Called from MLATest::initialize.
since | 2.30 |
---|
mla_put_markup_templates(array $templates) : boolean
since | 2.30 |
---|
array
name => value for all user-defined markup templates
boolean
true if success, false if failuremla_put_style_templates(array $templates) : boolean
since | 2.30 |
---|
array
name => value for all user-defined style templates
boolean
true if success, false if failure$mla_template_definitions
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
$mla_custom_templates : array
Templates are indexed by 'style'/'markup' and then shortcode name. Each template type is defined by:
since | 2.30 |
---|