/**
  * Localize $mla_language_option_definitions array
  *
  * Localization must be done at runtime, and these calls cannot be placed
  * in the "public static" array definition itself.
  *
  * @since 2.11
  *
  * @return	void
  */
 public static function mla_localize_language_option_definitions()
 {
     MLA_WPML::$mla_language_option_definitions = array('media_assistant_table_header' => array('tab' => 'language', 'name' => __('Media/Assistant submenu table', 'media-library-assistant'), 'type' => 'header'), 'language_column' => array('tab' => 'language', 'name' => __('Language Column', 'media-library-assistant'), 'type' => 'checkbox', 'std' => 'checked', 'help' => __('Check this option to add a Language column to the Media/Assistant submenu table.', 'media-library-assistant')), 'translations_column' => array('tab' => 'language', 'name' => __('Translations Column', 'media-library-assistant'), 'type' => 'checkbox', 'std' => 'checked', 'help' => __('Check this option to add a Translation Status column to the Media/Assistant submenu table.', 'media-library-assistant')), 'term_translation_header' => array('tab' => 'language', 'name' => __('Term Management', 'media-library-assistant'), 'type' => 'header'), 'term_assignment' => array('tab' => 'language', 'name' => __('Term Assignment', 'media-library-assistant'), 'type' => 'checkbox', 'std' => 'checked', 'help' => __('Check this option to assign language-specific terms when items are updated.'), 'media-library-assistant'), 'term_synchronization' => array('tab' => 'language', 'name' => __('Term Synchronization', 'media-library-assistant'), 'type' => 'checkbox', 'std' => 'checked', 'help' => __('Check this option to synchronize common terms among all item translations.'), 'media-library-assistant'), 'term_mapping_replication' => array('tab' => 'language', 'name' => __('Term Mapping Replication', 'media-library-assistant'), 'type' => 'checkbox', 'std' => 'checked', 'help' => __('When mapping IPTC/EXIF metadata to taxonomy terms, make them available in all languages.'), 'media-library-assistant'));
 }
Example #2
0
 /**
  * Initialization function, similar to __construct()
  *
  * This function contains add_action and add_filter calls
  * to set up the Ajax handlers, enqueue JavaScript and CSS files, and 
  * set up the Assistant submenu.
  *
  * @since 0.1
  *
  * @return	void
  */
 public static function initialize()
 {
     global $sitepress, $polylang;
     if ('checked' == MLAOptions::mla_get_option('enable_featured_image_generation')) {
         if (class_exists('MLA_Thumbnail')) {
             self::$mla_language_support_error_messages .= "<li>class MLA_Thumbnail</li>";
         } else {
             require_once MLA_PLUGIN_PATH . 'includes/class-mla-thumbnail-generation.php';
             MLA_Thumbnail::initialize();
         }
     }
     /*
      * Check for WPML/Polylang presence before loading language support class,
      * then immediately initialize it since we're already in the "init" action.
      */
     if (is_object($sitepress)) {
         if (class_exists('MLA_WPML')) {
             self::$mla_language_support_error_messages .= "<li>class MLA_WPML</li>";
         }
         if (class_exists('MLA_WPML_List_Table')) {
             self::$mla_language_support_error_messages .= "<li>class MLA_WPML_List_Table</li>";
         }
         if (class_exists('MLA_WPML_Table')) {
             self::$mla_language_support_error_messages .= "<li>class MLA_WPML_Table</li>";
         }
         if (empty(self::$mla_language_support_error_messages)) {
             require_once MLA_PLUGIN_PATH . 'includes/class-mla-wpml-support.php';
             MLA_WPML::initialize();
         }
     } elseif (is_object($polylang)) {
         if (class_exists('MLAPolylangSupport')) {
             self::$mla_language_support_error_messages .= '<li>class MLAPolylangSupport in plugin "MLA Polylang Support"</li>';
         }
         if (class_exists('MLA_Polylang')) {
             self::$mla_language_support_error_messages .= "<li>class MLA_Polylang</li>";
         }
         if (empty(self::$mla_language_support_error_messages)) {
             require_once MLA_PLUGIN_PATH . 'includes/class-mla-polylang-support.php';
             MLA_Polylang::initialize();
         }
     }
     if (!empty(self::$mla_language_support_error_messages)) {
         add_action('admin_notices', 'MLA::mla_name_conflict_reporting_action');
     }
     add_action('admin_init', 'MLA::mla_admin_init_action');
     add_action('admin_enqueue_scripts', 'MLA::mla_admin_enqueue_scripts_action');
     add_action('admin_menu', 'MLA::mla_admin_menu_action');
     add_filter('set-screen-option', 'MLA::mla_set_screen_option_filter', 10, 3);
     // $status, $option, $value
     add_filter('screen_options_show_screen', 'MLA::mla_screen_options_show_screen_filter', 10, 2);
     // $show_screen, $this
 }