MPSUM_Admin.php
7 years ago
MPSUM_Admin_Advanced.php
7 years ago
MPSUM_Admin_Advanced_Preview.php
7 years ago
MPSUM_Admin_Ajax.php
7 years ago
MPSUM_Admin_Bar.php
7 years ago
MPSUM_Admin_Core.php
7 years ago
MPSUM_Admin_Dashboard.php
7 years ago
MPSUM_Admin_Help.php
7 years ago
MPSUM_Admin_Logs.php
7 years ago
MPSUM_Admin_Plugins.php
7 years ago
MPSUM_Admin_Screen_Options.php
7 years ago
MPSUM_Admin_Themes.php
7 years ago
MPSUM_Advanced_Premium.php
7 years ago
MPSUM_Check_Plugin_Install_Status.php
7 years ago
MPSUM_Check_Theme_Install_Status.php
7 years ago
MPSUM_Commands.php
7 years ago
MPSUM_Disable_Updates.php
7 years ago
MPSUM_Disable_Updates_All.php
7 years ago
MPSUM_Disable_Updates_Plugins.php
7 years ago
MPSUM_Disable_Updates_Themes.php
7 years ago
MPSUM_Disable_Updates_Translations.php
7 years ago
MPSUM_Disable_Updates_WordPress.php
7 years ago
MPSUM_Exclude_Users.php
7 years ago
MPSUM_Force_Updates.php
7 years ago
MPSUM_List_Table.php
7 years ago
MPSUM_Logs.php
7 years ago
MPSUM_Logs_List_Table.php
7 years ago
MPSUM_Plugins_List_Table.php
7 years ago
MPSUM_Reset_Options.php
7 years ago
MPSUM_Themes_List_Table.php
7 years ago
MPSUM_UpdraftCentral.php
7 years ago
MPSUM_UpdraftCentral_EUM_Commands.php
7 years ago
MPSUM_Utils.php
7 years ago
easy-updates-manager-notices.php
7 years ago
updraft-notices.php
7 years ago
MPSUM_Disable_Updates_Translations.php
91 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Disables all WordPress translation updates. |
| 4 | * |
| 5 | * @package WordPress |
| 6 | * @since 5.0.0 |
| 7 | */ |
| 8 | |
| 9 | /** |
| 10 | * Disable tranlastion updates |
| 11 | * Credit - From https://wordpress.org/plugins/disable-wordpress-updates/ |
| 12 | */ |
| 13 | class MPSUM_Disable_Updates_Translations { |
| 14 | /** |
| 15 | * Constructor |
| 16 | */ |
| 17 | public function __construct() { |
| 18 | /* |
| 19 | * Disable All Automatic Updates |
| 20 | * 3.7+ |
| 21 | * |
| 22 | * @author sLa NGjI's @ slangji.wordpress.com |
| 23 | */ |
| 24 | add_filter('auto_update_translation', '__return_false'); |
| 25 | |
| 26 | /* |
| 27 | * Disable Theme Translations |
| 28 | * 2.8 to 3.0 |
| 29 | */ |
| 30 | add_filter('pre_transient_update_themes', array($this, 'remove_translations'), 10, 2); |
| 31 | |
| 32 | /* |
| 33 | * 3.0 |
| 34 | */ |
| 35 | add_filter('pre_site_transient_update_themes', array($this, 'remove_translations'), 10, 2); |
| 36 | |
| 37 | |
| 38 | /* |
| 39 | * Disable Plugin Translations |
| 40 | * 2.8 to 3.0 |
| 41 | */ |
| 42 | add_action('pre_transient_update_plugins', array($this, 'remove_translations'), 10, 2); |
| 43 | |
| 44 | /* |
| 45 | * 3.0 |
| 46 | */ |
| 47 | add_filter('pre_site_transient_update_plugins', array($this, 'remove_translations'), 10, 2); |
| 48 | |
| 49 | |
| 50 | /* |
| 51 | * Disable Core Translations |
| 52 | * 2.8 to 3.0 |
| 53 | */ |
| 54 | add_filter('pre_transient_update_core', array($this, 'remove_translations'), 10, 2); |
| 55 | |
| 56 | /* |
| 57 | * 3.0 |
| 58 | */ |
| 59 | add_filter('pre_site_transient_update_core', array($this, 'remove_translations'), 10, 2); |
| 60 | |
| 61 | } //end constructor |
| 62 | |
| 63 | /** |
| 64 | * Remove translations |
| 65 | * |
| 66 | * @param array $transient Transient options |
| 67 | * @param value $key Transient value name |
| 68 | * @return array |
| 69 | */ |
| 70 | public function remove_translations($transient, $key) { |
| 71 | remove_filter('pre_transient_update_themes', array($this, 'remove_translations'), 10, 2); |
| 72 | remove_filter('pre_site_transient_update_themes', array($this, 'remove_translations'), 10, 2); |
| 73 | remove_filter('pre_transient_update_plugins', array($this, 'remove_translations'), 10, 2); |
| 74 | remove_filter('pre_site_transient_update_plugins', array($this, 'remove_translations'), 10, 2); |
| 75 | remove_filter('pre_transient_update_core', array($this, 'remove_translations'), 10, 2); |
| 76 | remove_filter('pre_site_transient_update_core', array($this, 'remove_translations'), 10, 2); |
| 77 | $option = get_site_transient($key); |
| 78 | if (isset($option->translations)) { |
| 79 | $option->translations = array(); |
| 80 | } |
| 81 | add_filter('pre_transient_update_themes', array($this, 'remove_translations'), 10, 2); |
| 82 | add_filter('pre_site_transient_update_themes', array($this, 'remove_translations'), 10, 2); |
| 83 | add_filter('pre_transient_update_plugins', array($this, 'remove_translations'), 10, 2); |
| 84 | add_filter('pre_site_transient_update_plugins', array($this, 'remove_translations'), 10, 2); |
| 85 | add_filter('pre_transient_update_core', array($this, 'remove_translations'), 10, 2); |
| 86 | add_filter('pre_site_transient_update_core', array($this, 'remove_translations'), 10, 2); |
| 87 | ; |
| 88 | return $option; |
| 89 | } |
| 90 | } |
| 91 |