HEX
Server: LiteSpeed
System: Linux s3.sitechai.com 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: workzeni (2217)
PHP: 8.1.32
Disabled: mail, show_source, system, shell_exec, passthru, exec, eval, shell
Upload Files
File: /home/workzeni/ecom.workzenix.com/wp-content/plugins/shopengine/base/cpt.php
<?php

namespace ShopEngine\Base;

defined('ABSPATH') || exit;

/**
 * Cpt Abstract Class.
 * Cpt Abstract class for custom post type of Builders.
 *
 * @since 1.0.0
 */
abstract class Cpt {

	abstract public function post_type();

	abstract public function get_name();


	/**
	 * __construct function
	 * @since 1.0.0
	 */
	public function __construct() {

		// get custom post type name
		$name = $this->get_name();
		
		$args = $this->post_type();

		// register custom post type
		add_action('init', function() use ($name, $args) {
			register_post_type($name, $args);
		});
	}
}