Class MLA (Media Library Assistant) WPML provides admin mode support for the WPML Multilingual CMS family of plugins, including WPML Media
| package |
Media Library Assistant |
|---|---|
| since | 2.11 |
_add_relevant_term( $term, $translations = NULL, $skip_cache = false)
| since | 2.11 |
|---|---|
| uses | |
_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 |
stringthe target translation code
array$tax_inputs for Term Synchronization
_apply_tax_input(integer $post_id, string $post_language = NULL) : array
| since | 2.11 |
|---|---|
| uses |
integerID of the post to be updated
stringexplicit language_code; optional
arraylanguage-specific $tax_inputs
_apply_term_synchronization(integer $post_id) : array
| since | 2.15 |
|---|---|
| uses |
integerthe 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 | |
integerID of the current post
_build_tax_input(integer $post_id, array $tax_inputs = NULL, array $tax_actions = NULL)
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 | |
integerID 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 = NULL, boolean $test_only = false, $skip_cache = false)
| since | 2.11 |
|---|---|
| uses | |
stringto search in; 'id', 'name', or 'term_taxonomy_id'
mixedto search for; integer, string or integer
stringto search in; slug
stringcode; string; optional
booleanfalse (default) to add missing term, true to leave term out
_reset_language_settings() : array
| since | 2.11 |
|---|---|
arrayMessage(s) reflecting the results of the operation
_save_language_settings() : array
| since | 2.11 |
|---|---|
| uses | |
arrayMessage(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 |
integerID of the current post
array( taxonomy => term assignments ) before the update
admin_init() : void
| since | 2.11 |
|---|---|
initialize() : void
This function contains add_action and add_filter calls.
| since | 2.11 |
|---|---|
mla_begin_mapping( $source, $post_id = NULL)
| since | 2.20 |
|---|---|
mla_end_mapping() : void
| since | 2.20 |
|---|---|
mla_list_table_bulk_action_initial_request(array $request, string $bulk_action, array $custom_field_map) : array
| since | 2.11 |
|---|
arraybulk action request parameters, including ['mla_bulk_action_do_cleanup'].
stringthe requested action.
array[ slug => field_name ]
arrayupdated bulk action request parameters
mla_list_table_bulk_action_item_request(array $request, string $bulk_action, integer $post_id, array $custom_field_map) : array
| since | 2.11 |
|---|
arraybulk action request parameters, including ['mla_bulk_action_do_cleanup'].
stringthe requested action.
integerthe affected attachment.
array[ slug => field_name ]
arrayupdated bulk action request parameters
mla_list_table_custom_admin_action(string $mla_admin_action, integer $mla_item_ID)
| since | 2.11 |
|---|---|
stringthe requested action.
integerzero (0), or the affected attachment.
mla_list_table_inline_action(array $item_content, integer $post_id) : object
| since | 2.11 |
|---|
arrayNULL, to indicate no handler.
integerthe affected attachment.
objectupdated $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( $new_text, $setting_key, $post_id, $category, $attachment_metadata) : array
| since | 2.20 |
|---|
arrayupdated rule EXIF/Template value
mla_mapping_rule( $setting_value, $post_id, $category, $attachment_metadata)
| since | 2.20 |
|---|---|
mla_media_modal_begin_update_compat_fields( $post)
| since | 2.11 |
|---|---|
mla_media_modal_end_update_compat_fields( $results, $taxonomies, $post)
| since | 2.11 |
|---|---|
mla_media_modal_update_compat_fields_terms( $terms, $key, $value, $post_id)
| since | 2.11 |
|---|---|
mla_render_language_tab() : array
| since | 2.11 |
|---|---|
array( 'message' => '', 'body' => '' )
mla_updated_single_item(integer $post_id, integer $result)
| since | 2.15 |
|---|---|
integerID of the item that was updated.
integerZero 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( $translated, $type)
| since | 2.20 |
|---|---|
bulk_edit_map : array
| since | |
|---|---|
| var |
[ id ] => field name |
array
bulk_edit_request : array
| since | |
|---|---|
| var |
[ field ] => new value |
array
current_mapping_rule : array
| since | |
|---|---|
| var |
mapping rule |
array
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 | |
|---|---|
| var |
[ $term_taxonomy_id ] => array( $term, $details, $translations ) |
array
existing_terms : array
| since | |
|---|---|
| var |
['element_id'] => $post_id; [ 'language_code' ] => WPML item language or default language, e.g., 'en' [ 'slug' ] => Polylang item language or default language, e.g., 'en' [ $language ][ translation_details ] [ $language ][ $taxonomy ][ $term_taxonomy_id ] => $term |
array
tax_input : array
| since | |
|---|---|
| var |
['tax_input_post_id'] => $post_id; [ $language ][ $taxonomy ] => array of integer term_ids (hierarchical) [ $language ][ $taxonomy ] => comma-delimited string of term names (flat) |
array
wpml_content_defaults : array
| since | |
|---|---|
| var |
NULL or ( always_translate_media, duplicate_media, duplicate_featured ) |
array
updating_duplicates : boolean
| since | |
|---|---|
| var |
boolean
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