admin_enqueue_scripts()
admin_init()
attachment_fields_to_save()
edit_attachment()
initialize()
mla_get_options_tablist()
mla_get_terms_clauses()
mla_get_terms_query_arguments()
mla_list_table_add_pll_styles()
mla_list_table_build_inline_data()
mla_list_table_build_rollover_actions()
mla_list_table_bulk_action()
mla_list_table_bulk_action_initial_request()
mla_list_table_bulk_action_item_request()
mla_list_table_column_default()
mla_list_table_custom_bulk_action()
mla_list_table_get_bulk_actions()
mla_list_table_get_columns()
mla_list_table_inline_action()
mla_list_table_inline_fields()
mla_list_table_inline_parse()
mla_list_table_inline_values()
mla_list_table_prepare_items_pagination()
mla_list_table_prepare_items_total_items()
mla_list_table_submenu_arguments()
mla_localize_language_option_definitions()
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()
pll_translate_media()
quick_translate()
_add_relevant_term()
_apply_synch_input()
_apply_tax_input()
_build_existing_terms()
_build_tax_input()
_get_relevant_term()
_get_translation()
_reset_language_settings()
_save_language_settings()
_update_existing_terms()
$mla_language_option_definitions
$language_columns
$all_query_parameters
$bulk_action_includes
$duplicate_attachments
$existing_terms
$list_table_parameters
$relevant_terms
$tax_input
$upload_bulk_edit_args
$upload_bulk_edit_map
MLA_PLL_QUICK_TRANSLATE
Class MLA (Media Library Assistant) Polylang provides support for the Polylang Multilingual plugin
package | Media Library Assistant |
---|---|
since | 2.11 |
admin_enqueue_scripts(string $page_hook) : void
since | 2.11 |
---|
string
Name of the page being loaded
admin_init() : void
since | 2.11 |
---|
initialize() : void
since | 2.11 |
---|
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_Polylang::mla_get_terms_clauses.
since | 2.11 |
---|---|
uses | \global\MLA_Polylang::$all_query_parameters |
array
shortcode arguments merged with attachment selection defaults, so every possible parameter is present
array
updated attachment query argumentsmla_list_table_add_pll_styles() : void
since | 2.11 |
---|
mla_list_table_build_inline_data(string $inline_data, object $item) : string
Adds item-specific translations data for the JS quick and bulk edit functions.
since | 2.11 |
---|
string
The HTML markup for inline data.
object
The current Media Library item.
string
updated HTML markup for inline data.mla_list_table_build_rollover_actions(array $actions, object $item, string $column) : array
Adds "Quick Translate" to the list of item-level "Rollover" actions.
since | 2.11 |
---|
array
The list of item "Rollover" actions.
object
The current Media Library item.
string
The List Table column slug.
array
updated "Rollover" actions.mla_list_table_bulk_action(array $item_content, string $bulk_action, integer $post_id) : object
Sets the new item language from the Language dropdown selection.
since | 2.11 |
---|
array
NULL, to indicate no handler.
string
the requested action.
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_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_column_default(string $content, array $item, array $column_name) : string
Fills in the Language columns with the item's translation status values.
since | 2.11 |
---|
string
NULL, indicating no default content
array
A singular item (one full row's worth of data)
array
The name/slug of the column to be processed
string
Text or HTML to be placed inside the columnmla_list_table_custom_bulk_action(array $item_content, string $bulk_action, integer $post_id) : object
Creates new items from the "Bulk Translate" list.
since | 2.11 |
---|
array
NULL, to indicate no handler.
string
the requested action.
integer
the affected attachment.
object
updated $item_content. NULL if no handler, otherwise ( 'message' => error or status message(s), 'body' => '' )mla_list_table_get_bulk_actions(array $actions) : array
Adds the "Translate" action to the Bulk Actions list.
since | 2.11 |
---|
array
An array of bulk actions. Format: 'slug' => 'Label'
array
updated array of actions.mla_list_table_get_columns(array $columns) : array
Inserts the language columns just after the item thumbnail column
since | 2.11 |
---|
array
An array of columns. format: column_slug => Column Label
array
updated array of columns.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_list_table_inline_fields(array $fields) : string
Adds Language dropdown and Quick Translate links.
since | 2.11 |
---|
array
The field names for inline data.
string
updated fields for inline data.mla_list_table_inline_parse(string $html_markup, string $item_template, array $item_values) : array
since | 2.11 Adds Bulk Translate form and the Language dropdown markup used for the Quick and Bulk Edit forms. |
---|
string
HTML markup returned by the template parser
string
template used to generate the HTML markup
array
parameter_name => parameter_value pairs
array
updated HTML markup for the Quick and Bulk Edit formsmla_list_table_inline_values(array $item_values) : array
Builds the Language dropdown and edit translation links for the Quick and Bulk Edit forms.
since | 2.11 |
---|
array
parameter_name => parameter_value pairs
array
updated substitution parameter name => value pairsmla_list_table_prepare_items_pagination(array $pagination, object $mla_list_table) : array
Records the pagination parameters for use with custom table views, e.g., "attached".
since | 2.11 |
---|
array
Contains 'per_page', 'current_page'.
object
The MLA_List_Table object, passed by reference.
array
updated pagination array.mla_list_table_prepare_items_total_items(integer $total_items, object $mla_list_table) : integer
A convenient place to add the query argument required for the "Bulk Translate" custom view.
since | 2.11 |
---|
integer
NULL, indicating no substitution.
object
The MLA_List_Table object, passed by reference.
integer
updated total_items.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_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' => '' )pll_translate_media(integer $duplicated_attachment_id, object $duplicated_attachment_object, array $translations)
since | 2.11 |
---|
integer
ID of the new item
object
post object of the new item
array
an associative array of translations with language code as key and translation id as value
quick_translate() : void
since | 2.11 |
---|
_add_relevant_term(object $term, object $translations)
since | 2.11 |
---|---|
uses | \global\MLA_Polylang::$relevant_terms |
object
WordPress term object
object
Polylang translations object; 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_Polylang::$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_Polylang::$tax_input |
uses | \global\MLA_Polylang::$existing_terms |
integer
ID of the post to be updated
string
explicit language_code; optional
array
language-specific $tax_inputs_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_Polylang::$existing_terms |
uses | \global\MLA_Polylang::$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_Polylang::$tax_input |
uses | \global\MLA_Polylang::$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)
since | 2.11 |
---|---|
uses | \global\MLA_Polylang::$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
_get_translation(integer $post_id, string $new_language) : integer
since | 2.11 |
---|
integer
item ID
string
Slug of the desired language
integer
ID of the corresponding item in the desired language_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_Polylang::$existing_terms |
uses | \global\MLA_Polylang::$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_Polylang::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
$language_columns : array
since | 2.11 |
---|
$all_query_parameters : array
since | 2.11 |
---|
$bulk_action_includes : array
since | 2.11 |
---|
$existing_terms : array
since | 2.11 |
---|
$list_table_parameters : 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 |
---|
$upload_bulk_edit_args : array
since | 2.11 |
---|
$upload_bulk_edit_map : array
since | 2.11 |
---|
MLA_PLL_QUICK_TRANSLATE : string
since | 2.11 |
---|