golden hour
/home/godaofbq/zenearth.com/wp-content/plugins/polylang/include
⬆️ Go Up
Upload
File/Folder
Size
Actions
api.php
17.35 KB
Del
OK
base.php
5.79 KB
Del
OK
cache.php
2.44 KB
Del
OK
class-polylang.php
8.55 KB
Del
OK
cookie.php
3.35 KB
Del
OK
crud-posts.php
15.15 KB
Del
OK
crud-terms.php
9.87 KB
Del
OK
db-tools.php
1.01 KB
Del
OK
filter-rest-routes.php
4.87 KB
Del
OK
filters-links.php
5.55 KB
Del
OK
filters-sanitization.php
3.23 KB
Del
OK
filters-widgets-options.php
2.57 KB
Del
OK
filters.php
15.38 KB
Del
OK
functions.php
7 KB
Del
OK
language-deprecated.php
7.18 KB
Del
OK
language-factory.php
9.31 KB
Del
OK
language.php
18.04 KB
Del
OK
license.php
9.19 KB
Del
OK
links-abstract-domain.php
3.16 KB
Del
OK
links-default.php
3.03 KB
Del
OK
links-directory.php
9.49 KB
Del
OK
links-domain.php
3.06 KB
Del
OK
links-model.php
6.48 KB
Del
OK
links-permalinks.php
5.62 KB
Del
OK
links-subdomain.php
2.16 KB
Del
OK
links.php
1.3 KB
Del
OK
mo.php
1.97 KB
Del
OK
model.php
33.84 KB
Del
OK
nav-menu.php
4.43 KB
Del
OK
olt-manager.php
8.37 KB
Del
OK
query.php
6.39 KB
Del
OK
rest-request.php
3.12 KB
Del
OK
static-pages.php
6.26 KB
Del
OK
switcher.php
10.89 KB
Del
OK
translatable-object-with-types-interface.php
1.1 KB
Del
OK
translatable-object-with-types-trait.php
1.89 KB
Del
OK
translatable-object.php
13.27 KB
Del
OK
translatable-objects.php
3.49 KB
Del
OK
translate-option.php
12.46 KB
Del
OK
translated-object.php
16.39 KB
Del
OK
translated-post.php
11.88 KB
Del
OK
translated-term.php
9.77 KB
Del
OK
walker-dropdown.php
3.46 KB
Del
OK
walker-list.php
2.25 KB
Del
OK
walker.php
2.28 KB
Del
OK
widget-calendar.php
9.44 KB
Del
OK
widget-languages.php
4.57 KB
Del
OK
Edit: rest-request.php
<?php /** * @package Polylang */ /** * Main Polylang class for REST API requests, accessible from @see PLL(). * * @since 2.6 */ class PLL_REST_Request extends PLL_Base { /** * @var PLL_Language|false|null A `PLL_Language` when defined, `false` otherwise. `null` until the language * definition process runs. */ public $curlang; /** * @var PLL_Filters|null */ public $filters; /** * @var PLL_Filters_Links|null */ public $filters_links; /** * @var PLL_Admin_Links|null */ public $links; /** * @var PLL_Nav_Menu|null */ public $nav_menu; /** * @var PLL_Static_Pages|null */ public $static_pages; /** * @var PLL_Filters_Widgets_Options|null */ public $filters_widgets_options; /** * Constructor. * * @since 3.4 * * @param PLL_Links_Model $links_model Reference to the links model. */ public function __construct( &$links_model ) { parent::__construct( $links_model ); // Static front page and page for posts. // Early instantiated to be able to correctly initialize language properties. if ( 'page' === get_option( 'show_on_front' ) ) { $this->static_pages = new PLL_Static_Pages( $this ); } $this->model->set_languages_ready(); } /** * Setup filters. * * @since 2.6 * * @return void */ public function init() { parent::init(); if ( ! $this->model->has_languages() ) { return; } add_filter( 'rest_pre_dispatch', array( $this, 'set_language' ), 10, 3 ); $this->filters_links = new PLL_Filters_Links( $this ); $this->filters = new PLL_Filters( $this ); $this->filters_widgets_options = new PLL_Filters_Widgets_Options( $this ); $this->links = new PLL_Admin_Links( $this ); $this->nav_menu = new PLL_Frontend_Nav_Menu( $this ); // For auto added pages to menu. } /** * Sets the current language during a REST request if sent. * * @since 3.3 * * @param mixed $result Response to replace the requested version with. Remains untouched. * @param WP_REST_Server $server Server instance. * @param WP_REST_Request $request Request used to generate the response. * @return mixed Untouched $result. * * @phpstan-param WP_REST_Request<array{lang?: string}> $request */ public function set_language( $result, $server, $request ) { $lang = $request->get_param( 'lang' ); if ( ! empty( $lang ) && is_string( $lang ) ) { $this->curlang = $this->model->get_language( sanitize_key( $lang ) ); if ( empty( $this->curlang ) && ! empty( $this->options['default_lang'] ) && is_string( $this->options['default_lang'] ) ) { // A lang has been requested but it is invalid, let's fall back to the default one. $this->curlang = $this->model->get_language( sanitize_key( $this->options['default_lang'] ) ); } } if ( ! empty( $this->curlang ) ) { /** This action is documented in frontend/choose-lang.php */ do_action( 'pll_language_defined', $this->curlang->slug, $this->curlang ); } else { /** This action is documented in include/class-polylang.php */ do_action( 'pll_no_language_defined' ); // To load overridden textdomains. } return $result; } }
Save