403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : root ( 0)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/wp.9/wp-content/themes/dt-the7/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/wp.9/wp-content/themes/dt-the7/inc/class-the7-header-menus-override-handler.php
<?php
/**
 * Used in conjunction with 'Menus' metabox (and elementor tab in page settings).
 *
 * @package The7
 */

defined( 'ABSPATH' ) || exit;

class The7_Header_Menus_Override_Handler {

	/**
	 * @var int
	 */
	private $post_id;

	/**
	 * Header_Menu_Override constructor.
	 *
	 * @param int $post_id
	 */
	public function __construct( $post_id ) {
		$this->post_id = $post_id;
	}

	public function bootstrap() {
		if ( ! $this->post_id ) {
			return;
		}

		add_filter( 'presscore_nav_menu_args', [ $this, 'nav_menu_args_filter' ] );
		add_filter( 'presscore_pre_nav_menu', [ $this, 'presscore_pre_nav_menu_filter' ], 10, 2 );
		add_filter( 'presscore_has_mobile_menu', [ $this, 'presscore_has_mobile_menu_filter' ] );
	}

	/**
	 * @param array $args
	 *
	 * @return array
	 */
	public function nav_menu_args_filter( $args = array() ) {
		$location  = $args['theme_location'];
		$page_menu = (int) get_post_meta( $this->post_id, "_dt_microsite_{$location}_menu", true );

		if ( $page_menu > 0 ) {
			$args['menu'] = $page_menu;
		}

		return $args;
	}

	/**
	 * @param string|null $nav_menu
	 * @param array       $args
	 *
	 * @return mixed
	 */
	public function presscore_pre_nav_menu_filter( $nav_menu, $args = array() ) {
		$location  = $args['theme_location'];
		$page_menu = (int) get_post_meta( $this->post_id, "_dt_microsite_{$location}_menu", true );
		if ( $page_menu < 0 && isset( $args['fallback_cb'] ) && is_callable( $args['fallback_cb'] ) ) {
			$args['echo'] = false;

			return call_user_func( $args['fallback_cb'], $args );
		}

		return $nav_menu;
	}

	/**
	 * @param bool $has_menu
	 *
	 * @return bool
	 */
	public function presscore_has_mobile_menu_filter( $has_menu ) {
		$page_menu = (int) get_post_meta( $this->post_id, '_dt_microsite_mobile_menu', true );
		if ( 0 !== $page_menu ) {
			return true;
		}

		return $has_menu;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit