PluginProbe
Polylang / 2.8
Polylang v2.8
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
← All changes | admin/admin-base.php +4 -46 2.7.32.8 View file →
@@ -1,5 +1,8 @@
1 1 <?php
2 +/**
3 + * @package Polylang
4 + */
2 5
3 6 /**
4 7 * Base class for both admin
5 8 *
@@ -19,9 +22,9 @@
19 22 public function __construct( &$links_model ) {
20 23 parent::__construct( $links_model );
21 24
22 25 // Plugin i18n, only needed for backend
23 - load_plugin_textdomain( 'polylang', false, basename( POLYLANG_DIR ) . '/languages' );
26 + load_plugin_textdomain( 'polylang' );
24 27
25 28 // Adds the link to the languages panel in the WordPress admin menu
26 29 add_action( 'admin_menu', array( $this, 'add_menus' ) );
27 30
@@ -29,15 +32,8 @@
29 32 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
30 33 add_action( 'admin_print_footer_scripts', array( $this, 'admin_print_footer_scripts' ), 0 ); // High priority in case an ajax request is sent by an immediately invoked function
31 34
32 35 add_action( 'customize_controls_enqueue_scripts', array( $this, 'customize_controls_enqueue_scripts' ) );
33 -
34 - if ( defined( 'POLYLANG_PRO' ) ) {
35 - new PLL_Pro();
36 - } elseif ( ! defined( 'PLL_LINGOTEK_AD' ) || PLL_LINGOTEK_AD ) {
37 - require_once POLYLANG_DIR . '/lingotek/lingotek.php'; // Lingotek
38 - add_action( 'wp_loaded', array( new PLL_Lingotek(), 'init' ) );
39 - }
40 36 }
41 37
42 38 /**
43 39 * Setups filters and action needed on all admin pages and on plugins page
@@ -49,16 +45,8 @@
49 45 parent::init();
50 46
51 47 $this->notices = new PLL_Admin_Notices( $this );
52 48
53 - if ( Polylang::is_wizard() && class_exists( 'PLL_Wizard_Pro' ) ) {
54 - // Instantiate PLL_Wizard_Pro class after all PLL_Admin object is all initialized.
55 - // After PLL_Admin::maybe_load_sync_post which is hooked on admin_init with priority 20.
56 - add_action( 'admin_init', array( $this, 'instantiate_wizard_pro' ), 30 );
57 - }
58 -
59 - $this->wizard = new PLL_Wizard( $this );
60 -
61 49 if ( ! $this->model->get_languages_list() ) {
62 50 return;
63 51 }
64 52
@@ -72,14 +60,8 @@
72 60 add_filter( 'request', array( $this, 'request' ) );
73 61
74 62 // Adds the languages in admin bar
75 63 add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100 ); // 100 determines the position
76 -
77 - // Translate slugs, only for pretty permalinks
78 - if ( get_option( 'permalink_structure' ) && class_exists( 'PLL_Translate_Slugs' ) ) {
79 - $slugs_model = new PLL_Translate_Slugs_Model( $this );
80 - $this->translate_slugs = new PLL_Translate_Slugs( $slugs_model, $this->curlang );
81 - }
82 64 }
83 65
84 66 /**
85 67 * Adds the link to the languages panel in the WordPress admin menu
@@ -194,24 +176,8 @@
194 176 *
195 177 * @since 2.4.0
196 178 */
197 179 public function localize_scripts() {
198 - if ( wp_script_is( 'pll_classic-editor', 'enqueued' ) ) {
199 - wp_localize_script(
200 - 'pll_classic-editor',
201 - 'confirm_text',
202 - __( 'You are about to overwrite an existing translation. Are you sure you want to proceed?', 'polylang' )
203 - );
204 - }
205 -
206 - if ( wp_script_is( 'pll_block-editor', 'enqueued' ) ) {
207 - wp_localize_script(
208 - 'pll_block-editor',
209 - 'confirm_text',
210 - __( 'You are about to overwrite an existing translation. Are you sure you want to proceed?', 'polylang' )
211 - );
212 - }
213 -
214 180 if ( wp_script_is( 'pll_widgets', 'enqueued' ) ) {
215 181 wp_localize_script(
216 182 'pll_widgets',
217 183 'pll_widgets',
@@ -438,14 +404,6 @@
438 404 'meta' => 'all' === $lang->slug ? array() : array( 'lang' => esc_attr( $lang->get_locale( 'display' ) ) ),
439 405 )
440 406 );
441 407 }
442 - }
443 - /**
444 - * Instantiate PLL_Wizard_Pro class.
445 - *
446 - * @since 2.7
447 - */
448 - public function instantiate_wizard_pro() {
449 - $this->wizard_pro = new PLL_Wizard_Pro( $this );
450 408 }
451 409 }