403Webshell
Server IP : 185.68.16.147  /  Your IP : 216.73.216.209
Web Server : Apache
System : Linux web789.default-host.net 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
User : jt292766 ( 1182)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/jt292766/konstruktbud.com.ua/www/wp-content/plugins/polylang/src/Options/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/jt292766/konstruktbud.com.ua/www/wp-content/plugins/polylang/src/Options//Inactive_Option.php
<?php
/**
 * @package Polylang
 */

namespace WP_Syntex\Polylang\Options;

use WP_Error;
use WP_Syntex\Polylang\Options\Options;

defined( 'ABSPATH' ) || exit;

/**
 * Class defining a decorator for options when Polylang is not active on the current site.
 *
 * @since 3.8
 */
class Inactive_Option extends Abstract_Option {
	public const ERROR_CODE = 'pll_not_active';

	/**
	 * The option to decorate.
	 *
	 * @var Abstract_Option
	 */
	private $option;

	/**
	 * The key of the option to decorate.
	 *
	 * @var string
	 *
	 * @phpstan-var non-falsy-string
	 */
	private static $key = 'not-an-option';

	/**
	 * Constructor.
	 *
	 * @since 3.8
	 *
	 * @param Abstract_Option $option The option to wrap.
	 */
	public function __construct( Abstract_Option $option ) {
		$this->option = $option;
		$this->errors = new WP_Error();

		// Make sure the option doesn't contain any value.
		$this->option->reset();
	}

	/**
	 * Returns option key.
	 *
	 * @since 3.8
	 *
	 * @return string
	 *
	 * @phpstan-return non-falsy-string
	 */
	public static function key(): string {
		return self::$key;
	}

	/**
	 * Does nothing except adding an error.
	 *
	 * @since 3.8
	 *
	 * @param mixed   $value   Value to set.
	 * @param Options $options All options.
	 * @return bool True if the value has been assigned. False in case of errors.
	 */
	public function set( $value, Options $options ): bool { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
		if ( ! in_array( self::ERROR_CODE, $this->errors->get_error_codes(), true ) ) {
			$this->errors->add(
				self::ERROR_CODE,
				/* translators: %s is a blog ID. */
				sprintf( __( 'Polylang is not active on site %s.', 'polylang' ), (int) get_current_blog_id() )
			);
		}
		return false;
	}

	/**
	 * Returns the value of the option, usually the default value for inactive options.
	 *
	 * @since 3.8
	 *
	 * @return mixed
	 */
	public function get() {
		return $this->option->get();
	}

	/**
	 * Returns an empty schema.
	 *
	 * @since 3.8
	 *
	 * @return array The schema.
	 */
	public function get_schema(): array {
		return array();
	}

	/**
	 * Returns the default value.
	 *
	 * @since 3.8
	 *
	 * @return mixed
	 */
	protected function get_default() {
		return $this->option->get();
	}

	/**
	 * Not used but required by `Abstract_Option`.
	 *
	 * @since 3.8
	 *
	 * @return array Partial schema.
	 */
	protected function get_data_structure(): array {
		return array();
	}

	/**
	 * Not used but required by `Abstract_Option`.
	 *
	 * @since 3.8
	 *
	 * @return string
	 */
	protected function get_description(): string {
		return '';
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit