403Webshell
Server IP : 87.98.154.146  /  Your IP : 216.73.216.165
Web Server : Apache
System : Linux webm004.cluster126.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : ohklomafyi ( 52085)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/ohklomafyi/www/wp-content/plugins/templately/includes/Builder/Conditions/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/ohklomafyi/www/wp-content/plugins/templately/includes/Builder/Conditions/Post.php
<?php

namespace Templately\Builder\Conditions;

class Post extends Condition {
	private $post_type;

	public function __construct( $args = [] ) {
		$this->post_type = get_post_type_object( $args['post_type'] );

		parent::__construct( $args );
	}

	public function get_priority(): int {
		return 40;
	}

	public function get_type(): string {
		return 'singular';
	}

	public function get_label(): string {
		return $this->post_type->labels->singular_name;
	}

	public function get_all_label(): string {
		return $this->post_type->label;
	}

	public function get_name(): string {
		return $this->post_type->name;
	}

	public function check( $args = [] ): bool {
		if ( isset( $args['id'] ) ) {
			$id = (int) $args['id'];
			if ( $id ) {
				return is_singular() && get_queried_object_id() === $id;
			}
		}

		return is_singular( $this->post_type->name );
	}

	public function register_sub_conditions() {
//		foreach ( $this->post_taxonomies as $slug => $object ) {
//			$in_taxonomy = new In_Taxonomy( [
//				'object' => $object,
//			] );
//			$this->register_sub_condition( $in_taxonomy );
//
//			if ( $object->hierarchical ) {
//				$in_sub_term = new In_Sub_Term( [
//					'object' => $object,
//				] );
//				$this->register_sub_condition( $in_sub_term );
//			}
//		}
		
		$by_author = new PostByAuthor( $this->post_type );
		$this->register_sub_condition( $by_author );
	}

	protected function register_controls() {
		$this->add_control( "posts_query_" . $this->get_name(), [
			'field'      => 'id',
			'query_type' => 'posts',
			'options'    => [ '' => 'All' ],
			'query'      => [ 'post_type' => $this->get_name() ]
		] );
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit