| Linux server27.hostingraja.org 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64 Path : /home/udaipurk/www/websites/rishhh/wp-content/plugins/et-core-plugin/app/controllers/ |
| Current File : //home/udaipurk/www/websites/rishhh/wp-content/plugins/et-core-plugin/app/controllers/widgets.php |
<?php
namespace ETC\App\Controllers;
use ETC\App\Controllers\Base_Controller;
/**
* Create post type controller.
*
* @since 1.4.4
* @package ETC
* @subpackage ETC/Models/Admin
*/
class Widgets extends Base_Controller{
/**
* Registered widgets.
*
* @since 1.0.0
*
* @var array
*/
public static $widgets = NULL;
public function hooks() {
add_action( 'widgets_init', array( $this, 'register_widget' ) );
}
/**
* Register widget args
*
* @return mixed|null|void
*/
public static function widgets_args() {
if ( ! is_null( self::$widgets ) ) {
return self::$widgets;
}
return self::$widgets = apply_filters( 'etc/add/widget', array() );
}
/**
* Register Widgets
* @return null
*/
public function register_widget() {
// ! Register it only for XStore theme
if ( ! defined( 'ETHEME_THEME_NAME' ) || ETHEME_THEME_NAME != 'XStore' ) return;
$args = self::widgets_args();
foreach ( $args as $widget_classes ) {
foreach ( $widget_classes as $class ) {
register_widget( $class );
}
}
}
}