includes/tags/post-title.php * WowDevs\DynamicTags\Base\Tag_Base -> includes/base/tag-base.php * * The namespace mirrors the path, CamelCase becomes kebab-case, `_` becomes `-`. * Everything this plugin ships lives under includes/, so nothing else is searched. */ public function autoload( $class ) { if ( 0 !== strpos( $class, __NAMESPACE__ ) ) { return; } $filename = strtolower( preg_replace( [ '/^' . preg_quote( __NAMESPACE__, '/' ) . '\\\\/', '/([a-z])([A-Z])/', '/_/', '/\\\\/' ], [ '', '$1-$2', '-', DIRECTORY_SEPARATOR ], $class ) ); $filename = WOWDEVS_DT_INC_PATH . $filename . '.php'; if ( is_readable( $filename ) ) { include $filename; } } public function elementor_init() { $this->_manager = new Manager(); } protected function add_actions() { add_action( 'elementor/init', [ $this, 'elementor_init' ] ); } /** * Files that must exist before Elementor boots: the Dynamic Select control registers * itself on `elementor/controls/register`, and four tags use its control type. */ private function _includes() { require_once WOWDEVS_DT_INC_PATH . 'controls/select-input/dynamic-input-module.php'; require_once WOWDEVS_DT_INC_PATH . 'controls/select-input/dynamic-select.php'; require_once WOWDEVS_DT_INC_PATH . 'traits/utils-trait.php'; require_once WOWDEVS_DT_INC_PATH . 'manager.php'; } /** * Plugin constructor. */ private function __construct() { spl_autoload_register( [ $this, 'autoload' ] ); $this->_includes(); $this->add_actions(); } } if ( ! defined( 'WOWDEVS_DT_TESTS' ) ) { // In tests we run the instance manually. Plugin::instance(); }