403Webshell
Server IP : 172.67.147.195  /  Your IP : 216.73.216.142
Web Server : Apache/2
System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : mienphi ( 1014)
PHP Version : 8.2.14
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mienphi/public_html/wp-content/plugins/thim-elementor-kit/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mienphi/public_html/wp-content/plugins/thim-elementor-kit/inc/class-functions.php
<?php

namespace Thim_EL_Kit;

use Thim_EL_Kit\SingletonTrait;
use Thim_EL_Kit\Modules\Cache;

class Functions {
	use SingletonTrait;

	/**
	 * Output: Array ( [all] => Array ( [0] => 13506 [1] => 557 ) [course_categories] => Array ( [0] => 13506 ) )
	 */
	public function get_conditions_by_type( $type ) {
		$cache           = Cache::instance();
		$conditions_data = $cache->get( $type );
		$sorted_data     = array();
		$output          = array();

		foreach ( $conditions_data as $layout_id => $conditions ) {
			$post = get_post( $layout_id );

			if ( ! $post ) {
				continue;
			}

			if ( ! empty( $conditions ) && is_array($conditions)) {
				foreach ( $conditions as $condition ) {
					if ( 'publish' === $post->post_status ) {
						$sorted_data[ $condition['type'] ][ $condition['comparison'] ][] = $layout_id;
					}
				}
			}
		}

		foreach ( $sorted_data as $condition_type => $conditions ) {
			if ( isset( $conditions['include'] ) ) {
				foreach ( $conditions['include'] as $layout_id ) {
					$output[ $condition_type ][] = $layout_id;
				}
			}

			if ( isset( $conditions['exclude'] ) ) {
				// remove layout id from output
				foreach ( $conditions['exclude'] as $layout_id ) {
					if ( ! isset( $output[ $condition_type ] ) ) {
						continue;
					}
					$key = array_search( $layout_id, $output[ $condition_type ] );

					if ( false !== $key && isset( $output[ $condition_type ][ $key ] ) ) {
						unset( $output[ $condition_type ][ $key ] );
					}
				}
			}
		}

		return $output;
	}

	public function get_pages_loop_item( $post_type = '' ) {
		// Check not call on REST API
		$request_uri = $_SERVER['REQUEST_URI'];
		if ( false !== strpos( $request_uri, '/wp-json/' ) ) {
			return [];
		}

		// Get all page with post type thim_elementor_kit and type loop_item and post type is $post_type
		$args = array(
			'post_type'      => 'thim_elementor_kit',
			'posts_per_page' => - 1,
			'meta_query'     => array(
				array(
					'key'     => Custom_Post_Type::TYPE,
					'value'   => 'loop_item',
					'compare' => '=',
				),
			),
		);

		// Filter loop item page by post type.
		if ( ! empty( $post_type ) ) {
			$args['meta_query'][] = array(
				'key'     => 'thim_loop_item_post_type',
				'value'   => $post_type,
				'compare' => '=',
			);
		}

		$loop_items = get_posts( $args );

		$output = array();

		if ( ! empty( $loop_items ) ) {
			foreach ( $loop_items as $loop_item ) {
				$output[ $loop_item->ID ] = $loop_item->post_title;
			}
		}

		return $output;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit