Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/sitepres...
File: sitepress.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Plugin Name: WPML Multilingual CMS
[2] Fix | Delete
* Plugin URI: https://wpml.org/
[3] Fix | Delete
* Description: WPML Multilingual CMS | <a href="https://wpml.org">Documentation</a> | <a href="https://wpml.org/version/wpml-4-3-11/">WPML 4.3.11 release notes</a>
[4] Fix | Delete
* Author: OnTheGoSystems
[5] Fix | Delete
* Author URI: http://www.onthegosystems.com/
[6] Fix | Delete
* Version: 4.3.11
[7] Fix | Delete
* Plugin Slug: sitepress-multilingual-cms
[8] Fix | Delete
*
[9] Fix | Delete
* @package WPML\Core
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
use WPML\Container\Config;
[13] Fix | Delete
[14] Fix | Delete
if ( preg_match( '#' . basename( __FILE__ ) . '#', $_SERVER['PHP_SELF'] ) ) {
[15] Fix | Delete
die( 'You are not allowed to call this page directly.' );
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
$is_not_network_admin = ! function_exists( 'is_multisite' ) || ! is_multisite() || ! is_network_admin();
[19] Fix | Delete
if ( defined( 'ICL_SITEPRESS_VERSION' ) || ( (bool) get_option( '_wpml_inactive' ) && $is_not_network_admin ) ) {
[20] Fix | Delete
return;
[21] Fix | Delete
}
[22] Fix | Delete
[23] Fix | Delete
require_once 'classes/requirements/WordPress.php';
[24] Fix | Delete
if ( ! \WPML\Requirements\WordPress::checkMinimumRequiredVersion() ) {
[25] Fix | Delete
return;
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
define( 'ICL_SITEPRESS_VERSION', '4.3.11' );
[29] Fix | Delete
[30] Fix | Delete
// Do not uncomment the following line!
[31] Fix | Delete
// If you need to use this constant, use it in the wp-config.php file
[32] Fix | Delete
//define('ICL_SITEPRESS_DEV_VERSION', '3.4-dev');
[33] Fix | Delete
define( 'WPML_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
[34] Fix | Delete
define( 'WPML_PLUGIN_FOLDER', dirname( WPML_PLUGIN_BASENAME ) );
[35] Fix | Delete
define( 'WPML_PLUGIN_PATH', WP_PLUGIN_DIR . '/' . WPML_PLUGIN_FOLDER );
[36] Fix | Delete
define( 'WPML_PLUGIN_FILE', basename( WPML_PLUGIN_BASENAME ) );
[37] Fix | Delete
[38] Fix | Delete
/** @deprecated since 3.7.0 and will be removed in 3.8.0, use `WPML_PLUGIN_BASENAME` instead */
[39] Fix | Delete
define( 'ICL_PLUGIN_FULL_PATH', WPML_PLUGIN_BASENAME );
[40] Fix | Delete
/** @deprecated since 3.7.0 and will be removed in 3.8.0, use `WPML_PLUGIN_FOLDER` instead */
[41] Fix | Delete
define( 'ICL_PLUGIN_FOLDER', WPML_PLUGIN_FOLDER );
[42] Fix | Delete
/** @deprecated since 3.7.0 and will be removed in 3.8.0, use `WPML_PLUGIN_PATH` instead */
[43] Fix | Delete
define( 'ICL_PLUGIN_PATH', WPML_PLUGIN_PATH );
[44] Fix | Delete
/** @deprecated since 3.7.0 and will be removed in 3.8.0, use `WPML_PLUGIN_FILE` instead */
[45] Fix | Delete
define( 'ICL_PLUGIN_FILE', WPML_PLUGIN_FILE );
[46] Fix | Delete
[47] Fix | Delete
//PHP 5.2 backward compatibility
[48] Fix | Delete
if ( ! defined( 'FILTER_SANITIZE_FULL_SPECIAL_CHARS' ) ) {
[49] Fix | Delete
define( 'FILTER_SANITIZE_FULL_SPECIAL_CHARS', FILTER_SANITIZE_STRING );
[50] Fix | Delete
}
[51] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/functions-helpers.php';
[52] Fix | Delete
[53] Fix | Delete
$autoloader_dir = WPML_PLUGIN_PATH . '/vendor';
[54] Fix | Delete
if ( version_compare( PHP_VERSION, '5.3.0' ) >= 0 ) {
[55] Fix | Delete
$autoloader = $autoloader_dir . '/autoload.php';
[56] Fix | Delete
} else {
[57] Fix | Delete
$autoloader = $autoloader_dir . '/autoload_52.php';
[58] Fix | Delete
}
[59] Fix | Delete
require_once $autoloader;
[60] Fix | Delete
[61] Fix | Delete
add_action( 'plugins_loaded', 'wpml_disable_outdated_plugins', -PHP_INT_MAX );
[62] Fix | Delete
[63] Fix | Delete
function wpml_disable_outdated_plugins() {
[64] Fix | Delete
WPML_Plugins_Check::disable_outdated(
[65] Fix | Delete
file_get_contents( dirname( __FILE__ ) . '/wpml-dependencies.json' ),
[66] Fix | Delete
defined( 'WPML_TM_VERSION' ) ? WPML_TM_VERSION : '1.0',
[67] Fix | Delete
defined( 'WPML_ST_VERSION' ) ? WPML_ST_VERSION : '1.0',
[68] Fix | Delete
defined( 'WCML_VERSION' ) ? WCML_VERSION : '1.0'
[69] Fix | Delete
);
[70] Fix | Delete
}
[71] Fix | Delete
[72] Fix | Delete
$WPML_Dependencies = WPML_Dependencies::get_instance();
[73] Fix | Delete
[74] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/wpml-private-actions.php';
[75] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/functions.php';
[76] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/functions-sanitation.php';
[77] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/functions-security.php';
[78] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/wpml-post-comments.class.php';
[79] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/icl-admin-notifier.php';
[80] Fix | Delete
require_once WPML_PLUGIN_PATH . '/classes/container/functions.php';
[81] Fix | Delete
[82] Fix | Delete
if ( ! function_exists( 'filter_input' ) ) {
[83] Fix | Delete
wpml_set_plugin_as_inactive();
[84] Fix | Delete
add_action( 'admin_notices', 'wpml_missing_filter_input_notice' );
[85] Fix | Delete
[86] Fix | Delete
return;
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
$icl_plugin_url = untrailingslashit( plugin_dir_url( __FILE__ ) );
[90] Fix | Delete
if ( (bool) wpml_get_setting_filter( array(), 'language_domains' ) === true && isset( $_SERVER['HTTP_HOST'] ) ) {
[91] Fix | Delete
global $wpdb, $wpml_include_url_filter;
[92] Fix | Delete
[93] Fix | Delete
$wpml_include_url_filter = new WPML_Include_Url( $wpdb, $_SERVER['HTTP_HOST'] );
[94] Fix | Delete
$icl_plugin_url = $wpml_include_url_filter->filter_include_url( $icl_plugin_url );
[95] Fix | Delete
}
[96] Fix | Delete
define( 'ICL_PLUGIN_URL', $icl_plugin_url );
[97] Fix | Delete
[98] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/template-functions.php';
[99] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/js-scripts.php';
[100] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/lang-data.php';
[101] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/setup/sitepress-setup.class.php';
[102] Fix | Delete
[103] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/not-compatible-plugins.php';
[104] Fix | Delete
if ( ! empty( $icl_ncp_plugins ) ) {
[105] Fix | Delete
return;
[106] Fix | Delete
}
[107] Fix | Delete
[108] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/setup/sitepress-schema.php';
[109] Fix | Delete
[110] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/functions-load.php';
[111] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/constants.php';
[112] Fix | Delete
[113] Fix | Delete
/**
[114] Fix | Delete
* Initialize otgs/ui as soon as `WPML_PLUGIN_PATH` becomes available
[115] Fix | Delete
*/
[116] Fix | Delete
require_once $autoloader_dir . '/otgs/ui/loader.php';
[117] Fix | Delete
otgs_ui_initialize( WPML_PLUGIN_PATH . '/vendor/otgs/ui', ICL_PLUGIN_URL . '/vendor/otgs/ui' );
[118] Fix | Delete
[119] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/taxonomy-term-translation/wpml-term-translations.class.php';
[120] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/functions-troubleshooting.php';
[121] Fix | Delete
require_once WPML_PLUGIN_PATH . '/menu/term-taxonomy-menus/taxonomy-translation-display.class.php';
[122] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/taxonomy-term-translation/wpml-term-translation.class.php';
[123] Fix | Delete
[124] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/post-translation/wpml-post-translation.class.php';
[125] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/post-translation/wpml-admin-post-actions.class.php';
[126] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/post-translation/wpml-frontend-post-actions.class.php';
[127] Fix | Delete
[128] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/utilities/wpml-languages.class.php';
[129] Fix | Delete
require_once WPML_PLUGIN_PATH . '/menu/post-menus/post-edit-screen/wpml-meta-boxes-post-edit-html.class.php';
[130] Fix | Delete
[131] Fix | Delete
load_essential_globals();
[132] Fix | Delete
[133] Fix | Delete
require_once WPML_PLUGIN_PATH . '/sitepress.class.php';
[134] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/hacks.php';
[135] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/upgrade.php';
[136] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/language-switcher.php';
[137] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/import-xml.php';
[138] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/utilities/xml2array.php';
[139] Fix | Delete
[140] Fix | Delete
// using a plugin version that the db can't be upgraded to.
[141] Fix | Delete
if ( defined( 'WPML_UPGRADE_NOT_POSSIBLE' ) && WPML_UPGRADE_NOT_POSSIBLE ) {
[142] Fix | Delete
return;
[143] Fix | Delete
}
[144] Fix | Delete
[145] Fix | Delete
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
[146] Fix | Delete
$wpmu_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
[147] Fix | Delete
if ( false === get_option( 'icl_sitepress_version', false ) && isset( $wpmu_sitewide_plugins[ WPML_PLUGIN_BASENAME ] ) ) {
[148] Fix | Delete
icl_sitepress_activate();
[149] Fix | Delete
}
[150] Fix | Delete
[151] Fix | Delete
include_once WPML_PLUGIN_PATH . '/inc/functions-network.php';
[152] Fix | Delete
if ( get_option( '_wpml_inactive', false ) && isset( $wpmu_sitewide_plugins[ WPML_PLUGIN_BASENAME ] ) && $is_not_network_admin ) {
[153] Fix | Delete
wpml_set_plugin_as_inactive();
[154] Fix | Delete
[155] Fix | Delete
return;
[156] Fix | Delete
}
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
if ( ! wp_next_scheduled( 'update_wpml_config_index' ) ) {
[160] Fix | Delete
//Set cron job to update WPML config index file from CDN.
[161] Fix | Delete
wp_schedule_event( time(), 'daily', 'update_wpml_config_index' );
[162] Fix | Delete
}
[163] Fix | Delete
/** @var WPML_Post_Translation $wpml_post_translations */
[164] Fix | Delete
/** @var WPML_Language_Resolution $wpml_language_resolution */
[165] Fix | Delete
global $sitepress, $wpdb, $wpml_url_filters, $wpml_post_translations, $wpml_term_translations, $wpml_url_converter, $wpml_language_resolution, $wpml_slug_filter, $wpml_cache_factory;
[166] Fix | Delete
[167] Fix | Delete
$wpml_cache_factory = new WPML_Cache_Factory();
[168] Fix | Delete
[169] Fix | Delete
WPML\Container\share( Config::getSharedInstances() );
[170] Fix | Delete
WPML\Container\share( Config::getSharedClasses() );
[171] Fix | Delete
WPML\Container\alias( Config::getAliases() );
[172] Fix | Delete
WPML\Container\delegate( Config::getDelegated() );
[173] Fix | Delete
$sitepress = WPML\Container\make( '\SitePress' );
[174] Fix | Delete
[175] Fix | Delete
$action_filter_loader = new WPML_Action_Filter_Loader();
[176] Fix | Delete
[177] Fix | Delete
if ( $sitepress->is_setup_complete() ) {
[178] Fix | Delete
$actions = [
[179] Fix | Delete
'WPML_Copy_Once_Custom_Field_Factory',
[180] Fix | Delete
'WPML_Adjacent_Links_Hooks_Factory',
[181] Fix | Delete
'WPML_Widgets_Support_Factory',
[182] Fix | Delete
'WPML_Admin_Resources_Hooks_Factory',
[183] Fix | Delete
'WPML_Themes_Plugin_Localization_UI_Hooks_Factory',
[184] Fix | Delete
'WPML_Theme_Plugin_Localization_Options_Ajax_Factory',
[185] Fix | Delete
'WPML_Archives_Query_Factory',
[186] Fix | Delete
'WPML_Fix_Links_In_Display_As_Translated_Content_Factory',
[187] Fix | Delete
'WPML_Display_As_Translated_Tax_Query_Factory',
[188] Fix | Delete
'WPML_Tax_Permalink_Filters_Factory',
[189] Fix | Delete
'WPML_Display_As_Translated_Snippet_Filters_Factory',
[190] Fix | Delete
'WPML_Upgrade_Loader_Factory',
[191] Fix | Delete
'WPML_Post_Edit_Terms_Hooks_Factory',
[192] Fix | Delete
'WPML_Attachments_Urls_With_Identical_Slugs_Factory',
[193] Fix | Delete
'WPML_API_Hooks_Factory',
[194] Fix | Delete
'WPML_Cache_Terms_Per_Lang_Factory',
[195] Fix | Delete
'WPML_Display_As_Translated_Message_For_New_Post_Factory',
[196] Fix | Delete
'WPML_Custom_Fields_Post_Meta_Info_Factory',
[197] Fix | Delete
'WPML_Display_As_Translated_Default_Lang_Messages_Factory',
[198] Fix | Delete
'WPML_Absolute_Url_Persisted_Filters_Factory',
[199] Fix | Delete
'WPML_Meta_Boxes_Post_Edit_Ajax_Factory',
[200] Fix | Delete
'WPML_Wizard_Fetch_Content_Factory',
[201] Fix | Delete
'WPML_Privacy_Content_Factory',
[202] Fix | Delete
'WPML_Custom_Columns_Factory',
[203] Fix | Delete
'WPML_Config_Shortcode_List',
[204] Fix | Delete
'WPML_Config_Built_With_Page_Builders',
[205] Fix | Delete
'WPML_Endpoints_Support_Factory',
[206] Fix | Delete
'WPML_Installer_Domain_URL_Factory',
[207] Fix | Delete
'WPML_REST_Extend_Args_Factory',
[208] Fix | Delete
'WPML_WP_Options_General_Hooks_Factory',
[209] Fix | Delete
'WPML_WP_In_Subdir_URL_Filters_Factory',
[210] Fix | Delete
'WPML_Table_Collate_Fix',
[211] Fix | Delete
'\WPML\WP\OptionManager',
[212] Fix | Delete
'\WPML\Notices\DismissNotices',
[213] Fix | Delete
'\WPML\Ajax\Locale',
[214] Fix | Delete
];
[215] Fix | Delete
$action_filter_loader->load( $actions );
[216] Fix | Delete
[217] Fix | Delete
if ( $sitepress->is_translated_post_type( 'attachment' ) ) {
[218] Fix | Delete
$media_actions = [
[219] Fix | Delete
'WPML_Attachment_Action_Factory',
[220] Fix | Delete
'WPML_Media_Attachments_Duplication_Factory',
[221] Fix | Delete
'WPML_Deactivate_Old_Media_Factory',
[222] Fix | Delete
'WPML_Set_Attachments_Language_Factory',
[223] Fix | Delete
'WPML_Display_As_Translated_Attachments_Query_Factory',
[224] Fix | Delete
'WPML_Media_Settings_Factory',
[225] Fix | Delete
];
[226] Fix | Delete
[227] Fix | Delete
$action_filter_loader->load( $media_actions );
[228] Fix | Delete
}
[229] Fix | Delete
[230] Fix | Delete
$rest_factories = [
[231] Fix | Delete
'WPML_REST_Posts_Hooks_Factory',
[232] Fix | Delete
'WPML\Core\REST\RewriteRules',
[233] Fix | Delete
];
[234] Fix | Delete
[235] Fix | Delete
$action_filter_loader->load( $rest_factories );
[236] Fix | Delete
}
[237] Fix | Delete
[238] Fix | Delete
$sitepress->load_core_tm();
[239] Fix | Delete
[240] Fix | Delete
$wpml_wp_comments = new WPML_WP_Comments( $sitepress );
[241] Fix | Delete
$wpml_wp_comments->add_hooks();
[242] Fix | Delete
[243] Fix | Delete
new WPML_Global_AJAX( $sitepress );
[244] Fix | Delete
/** @var \WPML_WP_API $wpml_wp_api */
[245] Fix | Delete
$wpml_wp_api = $sitepress->get_wp_api();
[246] Fix | Delete
if ( $wpml_wp_api->is_support_page() ) {
[247] Fix | Delete
new WPML_Support_Page( $wpml_wp_api );
[248] Fix | Delete
}
[249] Fix | Delete
[250] Fix | Delete
wpml_load_query_filter( $sitepress->get_setting( 'setup_complete' ) );
[251] Fix | Delete
$wpml_canonicals = new WPML_Canonicals( $sitepress, new WPML_Translation_Element_Factory( $sitepress ) );
[252] Fix | Delete
$wpml_canonicals_hooks = new WPML_Canonicals_Hooks( $sitepress, $wpml_url_converter, array(
[253] Fix | Delete
'WPML_Root_Page',
[254] Fix | Delete
'is_current_request_root',
[255] Fix | Delete
) );
[256] Fix | Delete
$wpml_canonicals_hooks->add_hooks();
[257] Fix | Delete
$wpml_url_filters = new WPML_URL_Filters( $wpml_post_translations, $wpml_url_converter, $wpml_canonicals, $sitepress, new WPML_Debug_BackTrace( $wpml_wp_api->phpversion() ) );
[258] Fix | Delete
wpml_load_request_handler( is_admin(), $wpml_language_resolution->get_active_language_codes(), $sitepress->get_default_language() );
[259] Fix | Delete
[260] Fix | Delete
$tf_settings_read = new WPML_TF_Settings_Read();
[261] Fix | Delete
/** @var WPML_TF_Settings $tf_settings */
[262] Fix | Delete
$tf_settings = $tf_settings_read->get( 'WPML_TF_Settings' );
[263] Fix | Delete
$translation_feedback_module = new WPML_TF_Module( $action_filter_loader, $tf_settings );
[264] Fix | Delete
$translation_feedback_module->run();
[265] Fix | Delete
[266] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/url-handling/wpml-slug-filter.class.php';
[267] Fix | Delete
$wpml_slug_filter = new WPML_Slug_Filter( $wpdb, $sitepress, $wpml_post_translations );
[268] Fix | Delete
/** @var array $sitepress_settings */
[269] Fix | Delete
$sitepress_settings = $sitepress->get_settings();
[270] Fix | Delete
wpml_load_term_filters();
[271] Fix | Delete
wpml_maybe_setup_post_edit();
[272] Fix | Delete
[273] Fix | Delete
require_once WPML_PLUGIN_PATH . '/modules/cache-plugins-integration/cache-plugins-integration.php';
[274] Fix | Delete
require_once WPML_PLUGIN_PATH . '/inc/plugins-integration.php';
[275] Fix | Delete
[276] Fix | Delete
activate_installer( $sitepress );
[277] Fix | Delete
[278] Fix | Delete
if ( ( defined( 'DOING_CRON' ) && DOING_CRON ) || is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
[279] Fix | Delete
if ( $sitepress->get_setting( 'setup_complete' ) ) {
[280] Fix | Delete
setup_admin_menus();
[281] Fix | Delete
}
[282] Fix | Delete
}
[283] Fix | Delete
[284] Fix | Delete
if ( ! empty( $sitepress_settings['automatic_redirect'] ) ) {
[285] Fix | Delete
$wpml_browser_redirect = new WPML_Browser_Redirect( $sitepress );
[286] Fix | Delete
$wpml_browser_redirect->init_hooks();
[287] Fix | Delete
}
[288] Fix | Delete
[289] Fix | Delete
if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
[290] Fix | Delete
/** @var wp_xmlrpc_server $wp_xmlrpc_server */
[291] Fix | Delete
global $sitepress;
[292] Fix | Delete
$wpml_xmlrpc = new WPML_XMLRPC( $sitepress );
[293] Fix | Delete
$wpml_xmlrpc->init_hooks();
[294] Fix | Delete
}
[295] Fix | Delete
[296] Fix | Delete
if ( $sitepress->get_wp_api()->is_admin() ) {
[297] Fix | Delete
wpml_get_admin_notices();
[298] Fix | Delete
}
[299] Fix | Delete
[300] Fix | Delete
// activation hook
[301] Fix | Delete
register_deactivation_hook( WPML_PLUGIN_PATH . '/' . WPML_PLUGIN_FILE, 'icl_sitepress_deactivate' );
[302] Fix | Delete
[303] Fix | Delete
add_filter( 'plugin_action_links', 'icl_plugin_action_links', 10, 2 );
[304] Fix | Delete
[305] Fix | Delete
$WPML_Users_Languages_Dependencies = new WPML_Users_Languages_Dependencies( $sitepress );
[306] Fix | Delete
[307] Fix | Delete
function wpml_init_language_switcher() {
[308] Fix | Delete
global $wpml_language_switcher, $sitepress;
[309] Fix | Delete
[310] Fix | Delete
$wpml_language_switcher = new WPML_Language_Switcher( $sitepress );
[311] Fix | Delete
$wpml_language_switcher->init_hooks();
[312] Fix | Delete
}
[313] Fix | Delete
[314] Fix | Delete
function wpml_mlo_init() {
[315] Fix | Delete
global $sitepress, $wpdb;
[316] Fix | Delete
$array_helper = new WPML_Multilingual_Options_Array_Helper();
[317] Fix | Delete
$utils = new WPML_Multilingual_Options_Utils( $wpdb );
[318] Fix | Delete
$wpml_ml_options = new WPML_Multilingual_Options( $sitepress, $array_helper, $utils );
[319] Fix | Delete
$wpml_ml_options->init_hooks();
[320] Fix | Delete
}
[321] Fix | Delete
[322] Fix | Delete
/**
[323] Fix | Delete
* @param SitePress $sitepress
[324] Fix | Delete
*/
[325] Fix | Delete
function wpml_loaded( $sitepress ) {
[326] Fix | Delete
wpml_init_language_switcher();
[327] Fix | Delete
wpml_mlo_init();
[328] Fix | Delete
[329] Fix | Delete
$wpml_wp_api = $sitepress->get_wp_api();
[330] Fix | Delete
/**
[331] Fix | Delete
* Also allow `troubleshooting.php` and `theme-localization.php` because we have direct AJAX calls
[332] Fix | Delete
*
[333] Fix | Delete
* @see https://onthegosystems.myjetbrains.com/youtrack/issue/wpmlcore-5167
[334] Fix | Delete
*/
[335] Fix | Delete
if (
[336] Fix | Delete
$wpml_wp_api->is_back_end()
[337] Fix | Delete
|| $wpml_wp_api->is_core_page( 'troubleshooting.php' )
[338] Fix | Delete
|| $wpml_wp_api->is_core_page( 'theme-localization.php' )
[339] Fix | Delete
) {
[340] Fix | Delete
$main_menu = new WPML_Main_Admin_Menu( $sitepress );
[341] Fix | Delete
$main_menu->configure();
[342] Fix | Delete
}
[343] Fix | Delete
}
[344] Fix | Delete
[345] Fix | Delete
add_action( 'wpml_loaded', 'wpml_loaded' );
[346] Fix | Delete
[347] Fix | Delete
if ( $sitepress ) {
[348] Fix | Delete
add_action( 'init', 'wpml_integrations_requirements' );
[349] Fix | Delete
[350] Fix | Delete
if ( ! $wpml_wp_api->is_front_end() ) {
[351] Fix | Delete
$languages_ajax = new WPML_Languages_AJAX( $sitepress );
[352] Fix | Delete
$languages_ajax->ajax_hooks();
[353] Fix | Delete
}
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
function wpml_integrations_requirements() {
[357] Fix | Delete
global $sitepress;
[358] Fix | Delete
[359] Fix | Delete
$pbr = new WPML_Integrations_Requirements( $sitepress );
[360] Fix | Delete
$pbr->init_hooks();
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
function wpml_troubleshoot_action_load() {
[364] Fix | Delete
global $sitepress;
[365] Fix | Delete
$wpml_troubleshoot_action = new WPML_Troubleshoot_Action();
[366] Fix | Delete
if ( $wpml_troubleshoot_action->is_valid_request() ) {
[367] Fix | Delete
$wpml_troubleshoot_sync_posts_taxonomies = new WPML_Troubleshoot_Sync_Posts_Taxonomies( $sitepress, new WPML_Term_Translation_Utils( $sitepress ) );
[368] Fix | Delete
$wpml_troubleshoot_sync_posts_taxonomies->run();
[369] Fix | Delete
}
[370] Fix | Delete
}
[371] Fix | Delete
[372] Fix | Delete
add_action( 'admin_init', 'wpml_troubleshoot_action_load' );
[373] Fix | Delete
[374] Fix | Delete
function wpml_init_language_cookie_settings() {
[375] Fix | Delete
global $sitepress;
[376] Fix | Delete
[377] Fix | Delete
$wpml_cookie_setting = new WPML_Cookie_Setting( $sitepress );
[378] Fix | Delete
[379] Fix | Delete
if ( $sitepress->get_setting( 'setup_complete' ) && $sitepress->get_wp_api()->is_core_page( 'languages.php' ) ) {
[380] Fix | Delete
$wpml_cookie_admin_scripts = new WPML_Cookie_Admin_Scripts();
[381] Fix | Delete
$wpml_cookie_admin_scripts->enqueue();
[382] Fix | Delete
[383] Fix | Delete
$template_paths = array( ICL_PLUGIN_PATH . '/templates/cookie-setting' );
[384] Fix | Delete
$twig_template = new WPML_Twig_Template_Loader( $template_paths );
[385] Fix | Delete
$wpml_coolie_admin_ui = new WPML_Cookie_Admin_UI( $twig_template->get_template(), $wpml_cookie_setting );
[386] Fix | Delete
$wpml_coolie_admin_ui->add_hooks();
[387] Fix | Delete
}
[388] Fix | Delete
[389] Fix | Delete
if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
[390] Fix | Delete
$wpml_cookie_setting_ajax = new WPML_Cookie_Setting_Ajax( $wpml_cookie_setting );
[391] Fix | Delete
$wpml_cookie_setting_ajax->add_hooks();
[392] Fix | Delete
}
[393] Fix | Delete
}
[394] Fix | Delete
[395] Fix | Delete
add_action( 'admin_init', 'wpml_init_language_cookie_settings' );
[396] Fix | Delete
[397] Fix | Delete
$wpml_whip_requirements = new WPML_Whip_Requirements();
[398] Fix | Delete
$wpml_whip_requirements->add_hooks();
[399] Fix | Delete
[400] Fix | Delete
add_action( 'activated_plugin', [ 'WPML\Plugins', 'loadCoreFirst' ] );
[401] Fix | Delete
[402] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function