??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/pgtankstorage.sg/wp-content/plugins/polylang/src/base.php
⬅ Kembali
<?php
/**
* @package Polylang
*/
use WP_Syntex\Polylang\REST\Request;
use WP_Syntex\Polylang\Capabilities\Capabilities;
/**
* Base class for both admin and frontend
*
* @since 1.2
*/
#[AllowDynamicProperties]
abstract class PLL_Base {
/**
* Capabilities.
*
* @since 3.8
*
* @var Capabilities
*/
public $capabilities;
/**
* Stores the plugin options.
*
* @var \WP_Syntex\Polylang\Options\Options
*/
public $options;
/**
* @var PLL_Model
*/
public $model;
/**
* Instance of a child class of PLL_Links_Model.
*
* @var PLL_Links_Model
*/
public $links_model;
/**
* Registers hooks on insert / update post related actions and filters.
*
* @var PLL_CRUD_Posts|null
*/
public $posts;
/**
* Registers hooks on insert / update term related action and filters.
*
* @var PLL_CRUD_Terms|null
*/
public $terms;
/**
* @var Request
*/
public $request;
/**
* Constructor.
*
* @since 1.2
*
* @param PLL_Links_Model $links_model Links Model.
*/
public function __construct( PLL_Links_Model &$links_model ) {
$this->capabilities = new Capabilities();
$this->links_model = &$links_model;
$this->model = &$links_model->model;
$this->options = $this->model->options;
$this->request = new Request( $this->model );
$GLOBALS['l10n_unloaded']['pll_string'] = true; // Short-circuit _load_textdomain_just_in_time() for 'pll_string' domain in WP 4.6+
add_action( 'widgets_init', array( $this, 'widgets_init' ) );
// User defined strings translations
add_action( 'pll_language_defined', array( $this, 'load_strings_translations' ), 5 );
add_action( 'change_locale', array( $this, 'load_strings_translations' ) ); // Since WP 4.7
add_action( 'personal_options_update', array( $this, 'load_strings_translations' ), 1, 0 ); // Before WP, for confirmation request when changing the user email.
add_action( 'lostpassword_post', array( $this, 'load_strings_translations' ), 10, 0 ); // Password reset email.
// Switch_to_blog
add_action( 'switch_blog', array( $this, 'switch_blog' ), 10, 2 );
}
/**
* Instantiates classes reacting to CRUD operations on posts and terms,
* only when at least one language is defined.
*
* @since 2.6
*
* @return void
*/
public function init() {
if ( $this->model->has_languages() ) {
$this->posts = new PLL_CRUD_Posts( $this );
$this->terms = new PLL_CRUD_Terms( $this );
// WordPress options.
new PLL_Translate_Option( 'blogname', array(), array( 'context' => 'WordPress' ) );
new PLL_Translate_Option( 'blogdescription', array(), array( 'context' => 'WordPress' ) );
new PLL_Translate_Option( 'date_format', array(), array( 'context' => 'WordPress' ) );
new PLL_Translate_Option( 'time_format', array(), array( 'context' => 'WordPress' ) );
}
}
/**
* Registers our widgets
*
* @since 0.1
*
* @return void
*/
public function widgets_init() {
register_widget( 'PLL_Widget_Languages' );
// Overwrites the calendar widget to filter posts by language
if ( ! defined( 'PLL_WIDGET_CALENDAR' ) || PLL_WIDGET_CALENDAR ) {
unregister_widget( 'WP_Widget_Calendar' );
register_widget( 'PLL_Widget_Calendar' );
}
}
/**
* Loads user defined strings translations
*
* @since 1.2
* @since 2.1.3 $locale parameter added.
*
* @param string $locale Language locale or slug. Defaults to current locale.
* @return void
*/
public function load_strings_translations( $locale = '' ) {
if ( empty( $locale ) ) {
$locale = ( is_admin() && ! Polylang::is_ajax_on_front() ) ? get_user_locale() : get_locale();
}
$language = $this->model->get_language( $locale );
if ( ! empty( $language ) ) {
$mo = new PLL_MO();
$mo->import_from_db( $language );
$GLOBALS['l10n']['pll_string'] = &$mo;
} else {
unset( $GLOBALS['l10n']['pll_string'] );
}
}
/**
* Resets some variables when the blog is switched.
* Applied only if Polylang is active on the new blog.
*
* @since 1.5.1
*
* @param int $new_blog_id New blog ID.
* @param int $prev_blog_id Previous blog ID.
* @return void
*/
public function switch_blog( $new_blog_id, $prev_blog_id ) {
if ( (int) $new_blog_id === (int) $prev_blog_id ) {
// Do nothing if same blog.
return;
}
$this->links_model->remove_filters();
if ( $this->is_active_on_current_site() ) {
$this->links_model = $this->model->get_links_model();
}
}
/**
* Checks if Polylang is active on the current blog (useful when the blog is switched).
*
* @since 3.5.2
*
* @return bool
*/
protected function is_active_on_current_site(): bool {
return pll_is_plugin_active( POLYLANG_BASENAME ) && ! empty( $this->options['version'] );
}
/**
* Check if the customize menu should be removed or not.
*
* @since 3.2
*
* @return bool True if it should be removed, false otherwise.
*/
public function should_customize_menu_be_removed() {
// Exit if a block theme isn't activated.
if ( ! function_exists( 'wp_is_block_theme' ) || ! wp_is_block_theme() ) {
return false;
}
return ! $this->is_customize_register_hooked();
}
/**
* Tells whether or not Polylang or third party callbacks are hooked to `customize_register`.
*
* @since 3.4.3
*
* @global $wp_filter
*
* @return bool True if Polylang's callbacks are hooked, false otherwise.
*/
protected function is_customize_register_hooked() {
global $wp_filter;
if ( empty( $wp_filter['customize_register'] ) || ! $wp_filter['customize_register'] instanceof WP_Hook ) {
return false;
}
/*
* 'customize_register' is hooked by:
* @see PLL_Nav_Menu::create_nav_menu_locations()
* @see PLL_Frontend_Static_Pages::filter_customizer()
*/
$floor = 0;
if ( ! empty( $this->nav_menu ) && (bool) $wp_filter['customize_register']->has_filter( 'customize_register', array( $this->nav_menu, 'create_nav_menu_locations' ) ) ) {
++$floor;
}
if ( ! empty( $this->static_pages ) && (bool) $wp_filter['customize_register']->has_filter( 'customize_register', array( $this->static_pages, 'filter_customizer' ) ) ) {
++$floor;
}
$count = array_sum( array_map( 'count', $wp_filter['customize_register']->callbacks ) );
return $count > $floor;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
📁 Capabilities
dir
—
2026-06-17 21:10
📁 Model
dir
—
2026-06-17 21:10
📁 Options
dir
—
2026-06-17 21:10
📁 admin
dir
—
2026-06-17 21:10
📁 frontend
dir
—
2026-06-17 21:10
📁 install
dir
—
2026-06-17 21:10
📁 integrations
dir
—
2026-06-17 21:10
📁 modules
dir
—
2026-06-17 21:10
📁 settings
dir
—
2026-06-17 21:10
🐘 api.php
php
21.8 KB
2026-06-17 21:10
🐘 base.php
php
6.1 KB
2026-06-17 21:10
🐘 cache.php
php
2.4 KB
2026-06-17 21:10
🐘 class-polylang.php
php
8.3 KB
2026-06-17 21:10
🐘 constant-functions.php
php
1.8 KB
2026-06-17 21:10
🐘 cookie.php
php
3 KB
2026-06-17 21:10
🐘 crud-posts.php
php
14.7 KB
2026-06-17 21:10
🐘 crud-terms.php
php
8.8 KB
2026-06-17 21:10
🐘 default-term.php
php
6.4 KB
2026-06-17 21:10
🐘 filter-rest-routes.php
php
5 KB
2026-06-17 21:10
🐘 filters-links.php
php
5.6 KB
2026-06-17 21:10
🐘 filters-sanitization.php
php
3.2 KB
2026-06-17 21:10
🐘 filters-widgets-options.php
php
2.6 KB
2026-06-17 21:10
🐘 filters.php
php
12.9 KB
2026-06-17 21:10
🐘 format-util.php
php
3 KB
2026-06-17 21:10
🐘 functions.php
php
5.1 KB
2026-06-17 21:10
🐘 language-deprecated.php
php
7.1 KB
2026-06-17 21:10
🐘 language-factory.php
php
9.4 KB
2026-06-17 21:10
🐘 language.php
php
18.1 KB
2026-06-17 21:10
🐘 license.php
php
9.4 KB
2026-06-17 21:10
🐘 links-abstract-domain.php
php
3.2 KB
2026-06-17 21:10
🐘 links-default.php
php
3 KB
2026-06-17 21:10
🐘 links-directory.php
php
9.5 KB
2026-06-17 21:10
🐘 links-domain.php
php
2.9 KB
2026-06-17 21:10
🐘 links-model.php
php
6.5 KB
2026-06-17 21:10
🐘 links-permalinks.php
php
5.6 KB
2026-06-17 21:10
🐘 links-subdomain.php
php
2.2 KB
2026-06-17 21:10
🐘 links.php
php
1.4 KB
2026-06-17 21:10
🐘 mo.php
php
3.4 KB
2026-06-17 21:10
🐘 model.php
php
23 KB
2026-06-17 21:10
🐘 nav-menu.php
php
4.5 KB
2026-06-17 21:10
🐘 olt-manager.php
php
3 KB
2026-06-17 21:10
🐘 query.php
php
7.7 KB
2026-06-17 21:10
🐘 rest-request.php
php
4.2 KB
2026-06-17 21:10
🐘 static-pages.php
php
6.3 KB
2026-06-17 21:10
🐘 switcher.php
php
11 KB
2026-06-17 21:10
🐘 term-slug.php
php
4.9 KB
2026-06-17 21:10
🐘 translatable-object-with-types-interface.php
php
1 KB
2026-06-17 21:10
🐘 translatable-object-with-types-trait.php
php
2 KB
2026-06-17 21:10
🐘 translatable-object.php
php
17.6 KB
2026-06-17 21:10
🐘 translatable-objects.php
php
3.7 KB
2026-06-17 21:10
🐘 translate-option.php
php
13.1 KB
2026-06-17 21:10
🐘 translated-object.php
php
18.9 KB
2026-06-17 21:10
🐘 translated-post.php
php
17.2 KB
2026-06-17 21:10
🐘 translated-term.php
php
14.8 KB
2026-06-17 21:10
🐘 walker-dropdown.php
php
3.8 KB
2026-06-17 21:10
🐘 walker-list.php
php
2.5 KB
2026-06-17 21:10
🐘 walker.php
php
2.4 KB
2026-06-17 21:10
🐘 widget-calendar.php
php
11.6 KB
2026-06-17 21:10
🐘 widget-languages.php
php
5.3 KB
2026-06-17 21:10