admin_init()
attachment_fields_to_save()
edit_attachment()
initialize()
mla_begin_mapping()
mla_end_mapping()
mla_get_options_tablist()
mla_get_terms_clauses()
mla_get_terms_query_arguments()
mla_list_table_bulk_action_initial_request()
mla_list_table_bulk_action_item_request()
mla_list_table_custom_admin_action()
mla_list_table_inline_action()
mla_localize_language_option_definitions()
mla_mapping_new_text()
mla_mapping_rule()
mla_media_modal_begin_update_compat_fields()
mla_media_modal_end_update_compat_fields()
mla_media_modal_update_compat_fields_terms()
mla_render_language_tab()
mla_update_attachment_metadata_postfilter()
mla_updated_single_item()
mla_upload_bulk_edit_form_values()
post_updated_messages()
pre_wpml_is_translated_post_type_filter()
wpml_media_create_duplicate_attachment()
_add_relevant_term()
_apply_synch_input()
_apply_tax_input()
_apply_term_synchronization()
_build_existing_terms()
_build_tax_input()
_get_relevant_term()
_reset_language_settings()
_save_language_settings()
_update_existing_terms()
$mla_language_option_definitions
$all_query_parameters
$bulk_edit_map
$bulk_edit_request
$current_mapping_rule
$duplicate_attachments
$existing_terms
$relevant_terms
$tax_input
$updating_duplicates
$wpml_content_defaults
Class MLA (Media Library Assistant) WPML provides support for the WPML Multilingual CMS family of plugins, including WPML Media
package | Media Library Assistant |
---|---|
since | 2.11 |
admin_init() : void
since | 2.11 |
---|
initialize() : void
This function contains add_action and add_filter calls.
since | 2.11 |
---|
mla_begin_mapping(string $source, mixed $post_id)
since | 2.20 |
---|
string
what kind of mapping action is starting: single_custom, single_iptc_exif, bulk_custom, bulk_iptc_exif, create_metadata, update_metadata, custom_fields, custom_rule, iptc_exif_standard, iptc_exif_taxonomy, iptc_exif_custom, iptc_exif_custom_rule
mixed
Attachment ID or NULL, depending on scope
mla_end_mapping() : void
since | 2.20 |
---|
mla_get_terms_clauses(array $clauses) : array
Adds language-specific clauses to filter the cloud terms.
since | 2.11 |
---|
array
SQL clauses ( 'fields', 'join', 'where', 'order', 'orderby', 'limits' )
array
updated SQL clausesmla_get_terms_query_arguments(array $all_query_parameters) : array
Saves [mla_tag_cloud] query parameters for use in MLA_WPML::mla_get_terms_clauses.
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$all_query_parameters |
array
shortcode arguments merged with attachment selection defaults, so every possible parameter is present
array
updated attachment query argumentsmla_list_table_bulk_action_initial_request(array $request, string $bulk_action, array $custom_field_map) : array
since | 2.11 |
---|
array
bulk action request parameters, including ['mla_bulk_action_do_cleanup'].
string
the requested action.
array
[ slug => field_name ]
array
updated bulk action request parametersmla_list_table_bulk_action_item_request(array $request, string $bulk_action, integer $post_id, array $custom_field_map) : array
since | 2.11 |
---|
array
bulk action request parameters, including ['mla_bulk_action_do_cleanup'].
string
the requested action.
integer
the affected attachment.
array
[ slug => field_name ]
array
updated bulk action request parametersmla_list_table_custom_admin_action(string $mla_admin_action, integer $mla_item_ID)
since | 2.11 |
---|
string
the requested action.
integer
zero (0), or the affected attachment.
mla_list_table_inline_action(array $item_content, integer $post_id) : object
since | 2.11 |
---|
array
NULL, to indicate no handler.
integer
the affected attachment.
object
updated $item_content. NULL if no handler, otherwise ( 'message' => error or status message(s), 'body' => '', 'prevent_default' => true to bypass the MLA handler )mla_localize_language_option_definitions() : void
Localization must be done at runtime, and these calls cannot be placed in the "public static" array definition itself.
since | 2.11 |
---|
mla_mapping_new_text(mixed $new_text, string $setting_key, integer $post_id, string $category, array $attachment_metadata) : array
since | 2.20 |
---|
mixed
string or array value returned by the rule
string
field name or taxonomy name
integer
post ID to be evaluated
string
category/scope to evaluate against: iptc_exif_standard_mapping, iptc_exif_taxonomy_mapping or iptc_exif_custom_mapping
array
attachment_metadata, default NULL
array
updated rule EXIF/Template valuemla_mapping_rule(array $setting_value, integer $post_id, string $category, array $attachment_metadata)
since | 2.20 |
---|
array
mapping rule
integer
post ID to be evaluated
string
category/scope to evaluate against: iptc_exif_standard_mapping, iptc_exif_taxonomy_mapping or iptc_exif_custom_mapping
array
attachment_metadata, default NULL
mla_media_modal_begin_update_compat_fields(object $post)
since | 2.11 |
---|
object
the current post
mla_media_modal_end_update_compat_fields(string $results, array $taxonomies, object $post)
since | 2.11 |
---|
string
HTML markup for the taxonomy meta box elements
array
supported taxonomy objects
object
current post object
mla_media_modal_update_compat_fields_terms(array $terms, string $key, object $value, integer $post_id)
since | 2.11 |
---|
array
assigned term id/name values
string
taxonomy slug
object
taxonomy object
integer
current post ID
mla_render_language_tab() : array
since | 2.11 |
---|
array
( 'message' => '', 'body' => '' )mla_updated_single_item(integer $post_id, integer $result)
since | 2.15 |
---|
integer
ID of the item that was updated.
integer
Zero if the update failed else ID of the item that was updated.
mla_upload_bulk_edit_form_values(array $page_values)
since | 2.20 |
---|
array
[ parameter_name => parameter_value ] pairs
pre_wpml_is_translated_post_type_filter(boolean $translated, string $type)
since | 2.20 |
---|
boolean
true if the post_type is language-specific
string
the post type
_add_relevant_term(object $term, object $translations, boolean $skip_cache)
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$relevant_terms |
object
WordPress term object
object
Sitepress translations object; optional
boolean
Ignore the Sitepress terms cache; optional
_apply_synch_input(string $language) : array
Assumes the "current post" in $existing_terms is the source and $existing_terms contains the target translation
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$existing_terms |
string
the target translation code
array
$tax_inputs for Term Synchronization_apply_tax_input(integer $post_id, string $post_language) : array
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$tax_input |
uses | \global\MLA_WPML::$existing_terms |
integer
ID of the post to be updated
string
explicit language_code; optional
array
language-specific $tax_inputs_apply_term_synchronization(integer $post_id) : array
since | 2.15 |
---|---|
uses | \global\MLA_WPML::$existing_terms |
integer
the item we're synchronizing to
array
$tax_inputs for Term Synchronization_build_existing_terms(integer $post_id)
Takes each translatable taxonomy and builds an array of language-specific term_id to term_id/term_name mappings for terms already assigned to the item translation.
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$existing_terms |
uses | \global\MLA_WPML::$relevant_terms |
integer
ID of the current post
_build_tax_input(integer $post_id, array $tax_inputs, array $tax_actions)
Takes each term from the $tax_inputs parameter and builds an array of language-specific term_id to term_id/term_name mappings for all languages.
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$tax_input |
uses | \global\MLA_WPML::$existing_terms |
integer
ID of the current post
array
'tax_input' request parameter
array
'tax_action' request parameter
_get_relevant_term(string $field, mixed $value, string $taxonomy, string $language, boolean $test_only, boolean $skip_cache)
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$relevant_terms |
string
to search in; 'id', 'name', or 'term_taxonomy_id'
mixed
to search for; integer, string or integer
string
to search in; slug
string
code; string; optional
boolean
false (default) to add missing term, true to leave term out
boolean
Ignore the Sitepress terms cache; optional
_reset_language_settings() : array
since | 2.11 |
---|
array
Message(s) reflecting the results of the operation_save_language_settings() : array
since | 2.11 |
---|---|
uses | \global\$_REQUEST |
array
Message(s) reflecting the results of the operation_update_existing_terms(integer $post_id) : array
Takes each translatable taxonomy and rebuilds the array of language-specific term_id to term_id/term_name mappings for the "current translation" represented by the $post_id.
since | 2.11 |
---|---|
uses | \global\MLA_WPML::$existing_terms |
uses | \global\MLA_WPML::$relevant_terms |
integer
ID of the current post
array
( taxonomy => term assignments ) before the update$mla_language_option_definitions
The array must be populated at runtime in MLA_WPML::mla_localize_language_option_definitions(), because localization calls cannot be placed in the "public static" array definition itself.
Each option is defined by an array with the elements documented in class-mla-options.php
$all_query_parameters : array
since | 2.11 |
---|
$bulk_edit_map : array
since | 2.11 |
---|
$bulk_edit_request : array
since | 2.11 |
---|
$current_mapping_rule : array
since | 2.20 |
---|
$existing_terms : array
since | 2.11 |
---|
$relevant_terms : array
NOTE: WPML uses term_taxonomy_id as the "element_id" in its translations; Polylang uses term_id as the "element_id".
since | 2.11 |
---|
$tax_input : array
since | 2.11 |
---|
$updating_duplicates : boolean
since | 2.20 |
---|
$wpml_content_defaults : array
since | 2.20 |
---|