HEX
Server: Apache
System: Linux webd004.cluster130.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: frenchy (106757)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/f/r/e/frenchy/www/french-american.org/current/vendor/timber/timber/lib/PostType.php
<?php

namespace Timber;

/**
 * Wrapper for the post_type object provided by WordPress
 * @since 1.0.4
*/
class PostType {

	/**
	 * @param string $post_type
	 */
	public function __construct( $post_type ) {
		$this->slug = $post_type;
		$this->init($post_type);
	}

	public function __toString() {
		return $this->slug;
	}

	protected function init( $post_type ) {
		$obj = get_post_type_object($post_type);
		if ( ! empty( $obj ) ) {
			foreach ( get_object_vars($obj) as $key => $value ) {
				if ( $key === '' || ord($key[0]) === 0 ) {
					continue;
				}
				$this->$key = $value;
			}
		}
	}
}