The Admin Interface system provides WordPress administrators with tools to link content across language sites, manage multilingual taxonomies, and visualize translation status throughout the WordPress admin area. This system integrates deeply with WordPress admin screens to provide seamless multilingual content management workflows.
For information about the frontend display of language switchers, see Frontend Display. For details about the underlying content linking mechanisms, see Content Management.
The admin interface consists of several coordinated subsystems that enhance various WordPress admin screens with multilingual functionality:
Sources: includes/MslsMetaBox.php includes/MslsPostTag.php includes/MslsCustomColumn.php includes/MslsMain.php
All admin components inherit from MslsMain
, which provides shared functionality for nonce verification, input processing, and cross-site data synchronization. The system integrates with WordPress through standard action and filter hooks, ensuring compatibility with the existing admin interface.
The MslsMetaBox
class adds translation linking functionality directly to the WordPress post editor. It provides two rendering modes based on the activate_autocomplete
option:
Sources: includes/MslsMetaBox.php17-26 includes/MslsMetaBox.php108-148
The meta box system registers itself during WordPress initialization and provides:
Component | Purpose | Key Methods |
---|---|---|
MslsMetaBox::init() | Registers WordPress hooks | add_meta_boxes , save_post , trashed_post |
render_select() | Classic dropdown interface | Uses wp_dropdown_pages() for hierarchical posts |
render_input() | Autocomplete interface | AJAX-powered search with suggest() endpoint |
set() | Saves translation links | Validates nonce and user capabilities |
The autocomplete interface relies on an AJAX endpoint that searches for linkable content across sites:
Sources: includes/MslsMetaBox.php34-68 includes/MslsMetaBox.php77-102
The suggest()
method handles cross-site content search by:
switch_to_blog()
get_posts()
queries with search parametersThe MslsCustomColumn
class adds visual indicators to WordPress admin list tables showing translation status across all language sites:
Sources: includes/MslsCustomColumn.php15-34 includes/MslsCustomColumn.php43-109
The column system displays:
The MslsCustomFilter
class adds dropdown filters to admin list tables for finding untranslated content:
Sources: includes/MslsCustomFilter.php43-59 includes/MslsCustomFilter.php68-84
The MslsPostTag
system provides interfaces for linking taxonomy terms across language sites. It supports both autocomplete and classic selection modes:
Sources: includes/MslsPostTag.php74-86 includes/MslsPostTag.php94-146
Mode | Class | Interface Elements | Data Source |
---|---|---|---|
Autocomplete | MslsPostTag | Text inputs with AJAX search | suggest() endpoint |
Classic | MslsPostTagClassic | HTML select dropdowns | get_terms() queries |
Both modes provide:
Sources: includes/MslsPostTag.php23-72 includes/MslsPostTagClassic.php22-152
The MslsAdminIcon
class generates consistent visual elements throughout the admin interface:
Sources: includes/MslsAdminIcon.php90-97 includes/MslsAdminIcon.php227-256
Type | Purpose | Output Format |
---|---|---|
flag | Visual language indicator | SVG flag icons with CSS classes |
label | Text-based language indicator | Language name badges |
action | Edit/create actions | WordPress Dashicons (edit/plus) |
The icon system automatically generates appropriate links:
Sources: includes/MslsAdminIcon.php206-220 includes/MslsAdminIcon.php263-286
Refresh this wiki