| 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/woodmart/inc/modules/header-builder/ |
Upload File : |
<?php
/**
* Header builder elements class file.
*
* @package woodmart
*/
namespace XTS\Modules\Header_Builder;
/**
* Include all elements classes and create their objects. AJAX handlers.
*/
class Elements {
/**
* Elements list.
*
* @var array
*/
public $elements = array(
'Root',
'Row',
'Column',
'Logo',
'Mainmenu',
'Menu',
'Burger',
'Cart',
'Wishlist',
'Compare',
'Search',
'Mobilesearch',
'Account',
'Categories',
'Divider',
'Space',
'Text',
'HTMLBlock',
'Button',
'Infobox',
'Social',
'Stickynavigation',
);
/**
* Elements object classes.
*
* @var array
*/
public $elements_classes = array();
/**
* Construct.
*/
public function __construct() {
add_action( 'init', array( $this, 'include_files' ), 8 );
add_action( 'wp_ajax_woodmart_get_builder_elements', array( $this, 'get_elements_ajax' ) );
}
/**
* Include elements classes.
*
* @return void
*/
public function include_files() {
if ( defined( 'WPML_PLUGIN_BASENAME' ) ) {
$this->elements[] = 'Languages';
}
require_once WOODMART_HB_DIR . 'elements/abstract/class-element.php';
foreach ( $this->elements as $class ) {
$path = WOODMART_HB_DIR . 'elements/class-' . strtolower( $class ) . '.php';
if ( file_exists( $path ) ) {
require_once $path;
$class_name = 'XTS\Modules\Header_Builder\Elements\\' . $class;
$this->elements_classes[ $class ] = new $class_name();
}
}
}
/**
* Get all elements.
*
* @return void
*/
public function get_elements_ajax() {
check_ajax_referer( 'woodmart-get-builder-elements-nonce', 'security' );
$elements = array();
foreach ( $this->elements_classes as $el => $class ) {
$args = $class->get_args();
if ( $args['addable'] ) {
$elements[] = $class->get_args();
}
}
echo wp_json_encode( $elements );
wp_die();
}
}