/**
 * Bootstraps MultilingualPress.
 *
 * @since   3.0.0
 * @wp-hook plugins_loaded
 *
 * @return bool Whether or not MultilingualPress was bootstrapped successfully.
 */
function bootstrap()
{
    $container = new AddOnlyContainer();
    $container->share('multilingualpress.properties', new ImmutablePluginProperties(__FILE__));
    $multilingualpress = new MultilingualPress($container);
    $multilingualpress->register_service_provider(new CoreServiceProvider())->register_service_provider(new APIServiceProvider())->register_service_provider(new AssetServiceProvider())->register_service_provider(new DatabaseServiceProvider())->register_service_provider(new FactoryProvider())->register_service_provider(new InstallationServiceProvider())->register_service_provider(new Module\AlternativeLanguageTitleInAdminBar\ServiceProvider())->register_service_provider(new Module\CustomPostTypeSupport\ServiceProvider())->register_service_provider(new Module\Trasher\ServiceProvider())->register_service_provider(new Module\UserAdminLanguage\ServiceProvider())->register_service_provider(new SiteDuplicationServiceProvider())->register_service_provider(new Widget\WidgetServiceProvider());
    /**
     * MultilingualPress functions.
     */
    require_once __DIR__ . '/src/functions.php';
    return $multilingualpress->bootstrap();
}
 /**
  * Constructor. Sets up the properties.
  *
  * @since 3.0.0
  */
 public function __construct()
 {
     parent::__construct('Mlp_Widget', __('Language Switcher', 'multilingual-press'), ['classname' => 'mlp_widget', 'description' => __('MultilingualPress Translations', 'multilingual-press'), 'customize_selective_refresh' => true]);
     // TODO: With WordPress 4.6 + 2, inject an asset manager instance.
     if (!isset($this->asset_manager)) {
         $this->asset_manager = MultilingualPress::resolve('multilingualpress.asset_manager');
     }
     // TODO: With WordPress 4.6 + 2, inject a view instance.
     if (!isset($this->view)) {
         $this->view = new WidgetView();
     }
     // Enqueue style if front end and widget is active (ei.e., it appears in a sidebar) or if in Customizer preview.
     if (!is_admin() && is_active_widget(false, false, $this->id_base) || is_customize_preview()) {
         $this->enqueue_style();
     }
 }
 /**
  * Returns the content IDs of all translations for the given content element data.
  *
  * @since 3.0.0
  *
  * @param int    $content_id Optional. Content ID. Defaults to 0.
  * @param string $type       Optional. Content type. Defaults to 'post'.
  * @param int    $site_id    Optional. Site ID. Defaults to 0.
  *
  * @return int[] An array with site IDs as keys and content IDs as values.
  */
 function get_translation_ids($content_id = 0, $type = 'post', $site_id = 0)
 {
     $content_id = get_default_content_id($content_id);
     if (!$content_id) {
         return [];
     }
     return MultilingualPress::resolve('multilingualpress.content_relations')->get_relations($site_id ?: get_current_blog_id(), $content_id, (string) $type);
 }
<?php

# -*- coding: utf-8 -*-
namespace PHPSTORM_META;

$STATIC_METHOD_TYPES = [new \Inpsyde\MultilingualPress\Service\Container() => ['' == '@', 'multilingualpress.active_plugins' instanceof \Inpsyde\MultilingualPress\SiteDuplication\ActivePlugins, 'multilingualpress.asset_factory' instanceof \Inpsyde\MultilingualPress\Asset\AssetFactory, 'multilingualpress.asset_manager' instanceof \Inpsyde\MultilingualPress\Asset\AssetManager, 'multilingualpress.attachment_copier' instanceof \Inpsyde\MultilingualPress\SiteDuplication\AttachmentCopier, 'multilingualpress.base_path_adapter' instanceof \Inpsyde\MultilingualPress\Common\BasePathAdapter, 'multilingualpress.content_relations' instanceof \Inpsyde\MultilingualPress\API\ContentRelations, 'multilingualpress.content_relations_table' instanceof \Inpsyde\MultilingualPress\Database\Table, 'multilingualpress.error_factory' instanceof \Inpsyde\MultilingualPress\Factory\ErrorFactory, 'multilingualpress.installer' instanceof \Inpsyde\MultilingualPress\Installation\Installer, 'multilingualpress.internal_locations' instanceof \Inpsyde\MultilingualPress\Core\InternalLocations, 'multilingualpress.languages' instanceof \Inpsyde\MultilingualPress\API\Languages, 'multilingualpress.languages_table' instanceof \Inpsyde\MultilingualPress\Database\Table, 'multilingualpress.module_manager' instanceof \Inpsyde\MultilingualPress\Module\ModuleManager, 'multilingualpress.network_plugin_deactivator' instanceof \Inpsyde\MultilingualPress\Installation\NetworkPluginDeactivator, 'multilingualpress.nonce_factory' instanceof \Inpsyde\MultilingualPress\Factory\FallbackNonceFactory, 'multilingualpress.plugin_settings_page' instanceof \Inpsyde\MultilingualPress\Common\Admin\SettingsPage, 'multilingualpress.plugin_settings_page_view' instanceof \Inpsyde\MultilingualPress\Core\Admin\PluginSettingsPage\View, 'multilingualpress.plugin_settings_updater' instanceof \Inpsyde\MultilingualPress\Core\Admin\PluginSettingsPage\PluginSettingsUpdater, 'multilingualpress.post_request_data_manipulator' instanceof \Inpsyde\MultilingualPress\Translation\RequestDataManipulator, 'multilingualpress.post_type_link_url_filter' instanceof \Inpsyde\MultilingualPress\Module\CustomPostTypeSupport\URLFilter, 'multilingualpress.post_type_repository' instanceof \Inpsyde\MultilingualPress\Module\CustomPostTypeSupport\PostTypeRepository, 'multilingualpress.post_type_support_settings_box' instanceof \Inpsyde\MultilingualPress\Common\Setting\SettingsBoxViewModel, 'multilingualpress.post_type_support_settings_nonce' instanceof \Inpsyde\MultilingualPress\Common\Nonce\Nonce, 'multilingualpress.post_type_support_settings_updater' instanceof \Inpsyde\MultilingualPress\Module\CustomPostTypeSupport\PostTypeSupportSettingsUpdater, 'multilingualpress.properties' instanceof \Inpsyde\MultilingualPress\Common\PluginProperties, 'multilingualpress.relationship_control_search' instanceof \Inpsyde\MultilingualPress\Relations\Post\Search\Search, 'multilingualpress.relationship_control_search_controller' instanceof \Inpsyde\MultilingualPress\Relations\Post\Search\SearchController, 'multilingualpress.relationship_control_search_results_view' instanceof \Inpsyde\MultilingualPress\Relations\Post\Search\SearchResultsView, 'multilingualpress.relationship_control_view' instanceof \Inpsyde\MultilingualPress\Relations\Post\RelationshipControlView, 'multilingualpress.relationship_controller' instanceof \Inpsyde\MultilingualPress\Relations\Post\RelationshipController, 'multilingualpress.request' instanceof \Inpsyde\MultilingualPress\Common\Request, 'multilingualpress.translation_completed_setting_nonce' instanceof \Inpsyde\MultilingualPress\Common\Nonce\Nonce, 'multilingualpress.site_duplicator' instanceof \Inpsyde\MultilingualPress\SiteDuplication\SiteDuplicator, 'multilingualpress.site_relations' instanceof \Inpsyde\MultilingualPress\API\SiteRelations, 'multilingualpress.site_relations_table' instanceof \Inpsyde\MultilingualPress\Database\Table, 'multilingualpress.system_checker' instanceof \Inpsyde\MultilingualPress\Installation\SystemChecker, 'multilingualpress.table_duplicator' instanceof \Inpsyde\MultilingualPress\Database\TableDuplicator, 'multilingualpress.table_installer' instanceof \Inpsyde\MultilingualPress\Database\TableInstaller, 'multilingualpress.table_list' instanceof \Inpsyde\MultilingualPress\Database\TableList, 'multilingualpress.table_replacer' instanceof \Inpsyde\MultilingualPress\Database\TableReplacer, 'multilingualpress.table_string_replacer' instanceof \Inpsyde\MultilingualPress\Database\TableStringReplacer, 'multilingualpress.translation_completed_setting_nonce' instanceof \Inpsyde\MultilingualPress\Common\Nonce\Nonce, 'multilingualpress.translation_completed_setting_updater' instanceof \Inpsyde\MultilingualPress\Widget\Dashboard\UntranslatedPosts\TranslationCompletedSettingUpdater, 'multilingualpress.translation_completed_setting_view' instanceof \Inpsyde\MultilingualPress\Widget\Dashboard\UntranslatedPosts\TranslationCompletedSettingView, 'multilingualpress.trasher' instanceof \Inpsyde\MultilingualPress\Module\Trasher\Trasher, 'multilingualpress.trasher_setting_nonce' instanceof \Inpsyde\MultilingualPress\Common\Nonce\Nonce, 'multilingualpress.trasher_setting_repository' instanceof \Inpsyde\MultilingualPress\Module\Trasher\TrasherSettingRepository, 'multilingualpress.trasher_setting_updater' instanceof \Inpsyde\MultilingualPress\Module\Trasher\TrasherSettingUpdater, 'multilingualpress.trasher_setting_view' instanceof \Inpsyde\MultilingualPress\Module\Trasher\TrasherSettingView, 'multilingualpress.type_factory' instanceof \Inpsyde\MultilingualPress\Factory\TypeFactory, 'multilingualpress.untranslated_posts_dashboard_widget' instanceof \Inpsyde\MultilingualPress\Widget\Dashboard\DashboardWidget, 'multilingualpress.untranslated_posts_dashboard_widget_view' instanceof \Inpsyde\MultilingualPress\Widget\Dashboard\View, 'multilingualpress.untranslated_posts_repository' instanceof \Inpsyde\MultilingualPress\Widget\Dashboard\UntranslatedPosts\PostRepository, 'multilingualpress.update_plugin_settings_nonce' instanceof \Inpsyde\MultilingualPress\Common\Nonce\Nonce, 'multilingualpress.updater' instanceof \Inpsyde\MultilingualPress\Installation\Updater, 'multilingualpress.user_admin_language_locale_filter' instanceof \Inpsyde\MultilingualPress\Module\UserAdminLanguage\LocaleFilter, 'multilingualpress.user_admin_language_repository' instanceof \Inpsyde\MultilingualPress\Module\UserAdminLanguage\LanguageRepository], \Inpsyde\MultilingualPress\MultilingualPress::resolve('') => ['' == '@', 'multilingualpress.asset_factory' instanceof \Inpsyde\MultilingualPress\Asset\AssetFactory, 'multilingualpress.asset_manager' instanceof \Inpsyde\MultilingualPress\Asset\AssetManager, 'multilingualpress.content_relations' instanceof \Inpsyde\MultilingualPress\API\ContentRelations, 'multilingualpress.content_relations_table' instanceof \Inpsyde\MultilingualPress\Database\Table, 'multilingualpress.error_factory' instanceof \Inpsyde\MultilingualPress\Factory\ErrorFactory, 'multilingualpress.internal_locations' instanceof \Inpsyde\MultilingualPress\Core\InternalLocations, 'multilingualpress.languages' instanceof \Inpsyde\MultilingualPress\API\Languages, 'multilingualpress.languages_table' instanceof \Inpsyde\MultilingualPress\Database\Table, 'multilingualpress.network_plugin_deactivator' instanceof \Inpsyde\MultilingualPress\Installation\NetworkPluginDeactivator, 'multilingualpress.nonce_factory' instanceof \Inpsyde\MultilingualPress\Factory\FallbackNonceFactory, 'multilingualpress.properties' instanceof \Inpsyde\MultilingualPress\Common\PluginProperties, 'multilingualpress.request' instanceof \Inpsyde\MultilingualPress\Common\Request, 'multilingualpress.site_relations' instanceof \Inpsyde\MultilingualPress\API\SiteRelations, 'multilingualpress.site_relations_table' instanceof \Inpsyde\MultilingualPress\Database\Table, 'multilingualpress.table_duplicator' instanceof \Inpsyde\MultilingualPress\Database\TableDuplicator, 'multilingualpress.table_installer' instanceof \Inpsyde\MultilingualPress\Database\TableInstaller, 'multilingualpress.table_list' instanceof \Inpsyde\MultilingualPress\Database\TableList, 'multilingualpress.table_replacer' instanceof \Inpsyde\MultilingualPress\Database\TableReplacer, 'multilingualpress.table_string_replacer' instanceof \Inpsyde\MultilingualPress\Database\TableStringReplacer, 'multilingualpress.type_factory' instanceof \Inpsyde\MultilingualPress\Factory\TypeFactory]];