MLA_PLL_QUICK_TRANSLATE
MLA_PLL_QUICK_TRANSLATE
Uniquely identifies the Quick Translate action
Class MLA (Media Library Assistant) Polylang provides support for the Polylang Multilingual plugin
$mla_language_option_definitions :
$mla_language_option_definitions defines the language-specific database options and admin page areas for setting/updating them
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
$existing_terms : array
Taxonomy terms for the current item translation in the database
mla_mapping_new_text( $new_text, $setting_key, $post_id, $category, $attachment_metadata) : array
Manages the creation of new taxonomy terms from metadata values
$new_text | ||
$setting_key | ||
$post_id | ||
$category | ||
$attachment_metadata |
updated rule EXIF/Template value
mla_list_table_inline_action(array $item_content, integer $post_id) : object
Captures the Quick Edit "before update" term assignments and process the Language dropdown selection, if changed
array | $item_content | NULL, to indicate no handler. |
integer | $post_id | the affected attachment. |
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
Captures the Bulk Edit, "Upload New Media" parameters
array | $request | bulk action request parameters, including ['mla_bulk_action_do_cleanup']. |
string | $bulk_action | the requested action. |
array | $custom_field_map | [ slug => field_name ] |
updated bulk action request parameters
mla_list_table_bulk_action_item_request(array $request, string $bulk_action, integer $post_id, array $custom_field_map) : array
Converts Bulk Edit taxonomy inputs to language-specific values
array | $request | bulk action request parameters, including ['mla_bulk_action_do_cleanup']. |
string | $bulk_action | the requested action. |
integer | $post_id | the affected attachment. |
array | $custom_field_map | [ slug => field_name ] |
updated bulk action request parameters
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.
array | $item_content | NULL, to indicate no handler. |
string | $bulk_action | the requested action. |
integer | $post_id | the affected attachment. |
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_custom_bulk_action(array $item_content, string $bulk_action, integer $post_id) : object
Creates new items from the "Bulk Translate" list.
array | $item_content | NULL, to indicate no handler. |
string | $bulk_action | the requested action. |
integer | $post_id | the affected attachment. |
updated $item_content. NULL if no handler, otherwise ( 'message' => error or status message(s), 'body' => '' )
mla_list_table_get_bulk_actions(array $actions) : array
Filter the MLA_List_Table bulk actions
Adds the "Translate" action to the Bulk Actions list.
array | $actions | An array of bulk actions. Format: 'slug' => 'Label' |
updated array of actions.
mla_list_table_inline_values(array $item_values) : array
MLA_List_Table inline edit item values
Builds the Language dropdown and edit translation links for the Quick and Bulk Edit forms, adding them to the 'custom_fields' and 'bulk_custom_fields' substitution parameters.
array | $item_values | parameter_name => parameter_value pairs |
updated substitution parameter name => value pairs
mla_list_table_get_columns(array $columns) : array
Filter the MLA_List_Table columns
Inserts the language columns just after the item thumbnail column
array | $columns | An array of columns. format: column_slug => Column Label |
updated array of columns.
mla_list_table_column_default( $content, $item, $column_name) : string
Supply a column value if no column-specific function has been defined
Fills in the Language columns with the item's translation status values.
$content | ||
$item | ||
$column_name |
Text or HTML to be placed inside the column
mla_list_table_submenu_arguments(array $submenu_arguments, object $include_filters) : array
Filter the "sticky" submenu URL parameters
Adds a language ('lang') parameter to the URL parameters that will be retained when the submenu page refreshes. Maintains the list of Bulk Translate items in the URLs for paging through the results.
array | $submenu_arguments | Current view, pagination and sort parameters. |
object | $include_filters | True to include "filter-by" parameters, e.g., year/month dropdown. |
updated submenu_arguments.
mla_list_table_prepare_items_pagination(array $pagination, object $mla_list_table) : array
Filter the pagination parameters for prepare_items()
Records the pagination parameters for use with custom table views, e.g., "attached".
array | $pagination | Contains 'per_page', 'current_page'. |
object | $mla_list_table | The MLA_List_Table object, passed by reference. |
updated pagination array.
mla_list_table_prepare_items_total_items(integer $total_items, object $mla_list_table) : integer
Filter the total items count for prepare_items()
A convenient place to add the query argument required for the "Bulk Translate" custom view.
integer | $total_items | NULL, indicating no substitution. |
object | $mla_list_table | The MLA_List_Table object, passed by reference. |
updated total_items.
mla_list_table_build_rollover_actions(array $actions, object $item, string $column) : array
Filter the list of item "Rollover" actions
Adds "Quick Translate" to the list of item-level "Rollover" actions.
array | $actions | The list of item "Rollover" actions. |
object | $item | The current Media Library item. |
string | $column | The List Table column slug. |
updated "Rollover" actions.
mla_list_table_build_inline_data(string $inline_data, object $item) : string
Filter the data for inline (Quick and Bulk) editing
Adds item-specific translations data for the JS quick and bulk edit functions.
string | $inline_data | The HTML markup for inline data. |
object | $item | The current Media Library item. |
updated HTML markup for inline data.
_get_relevant_term(string $field, mixed $value, string $taxonomy, string $language = NULL, boolean $test_only = false)
Finds a $relevant_term (if defined) given a key and (optional) a language
string | $field | to search in; 'id', 'name', or 'term_taxonomy_id' |
mixed | $value | to search for; integer, string or integer |
string | $taxonomy | to search in; slug |
string | $language | code; string; optional |
boolean | $test_only | false (default) to add missing term, true to leave term out |
_build_existing_terms(integer $post_id)
Build the $existing_terms array
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.
integer | $post_id | ID of the current post |
_update_existing_terms(integer $post_id) : array
Update the $existing_terms 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.
integer | $post_id | ID of the current post |
( taxonomy => term assignments ) before the update
_build_tax_input(integer $post_id, array $tax_inputs = NULL, array $tax_actions = NULL)
Build the $tax_input array
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.
integer | $post_id | ID of the current post |
array | $tax_inputs | 'tax_input' request parameter |
array | $tax_actions | 'tax_action' request parameter |
_apply_tax_input(integer $post_id, string $post_language = NULL) : array
Filter the $tax_input array to a specific language
integer | $post_id | ID of the post to be updated |
string | $post_language | explicit language_code; optional |
language-specific $tax_inputs
_apply_synch_input(string $language) : array
Compute Term Synchronization replacement $tax_inputs
Assumes the "current post" in $existing_terms is the source and $existing_terms contains the target translation
string | $language | the target translation code |
$tax_inputs for Term Synchronization