HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: /home/greer489/public_html/wp-content/themes/betheme/functions/widgets/class-mfn-widgets.php
<?php
if (! defined('ABSPATH')) {
	exit; // Exit if accessed directly
}

if (! class_exists('Mfn_Widgets')) {
  class Mfn_Widgets
  {
		private $widgets = array(
			'comments',
			'flickr',
			'login',
			'menu',
			'posts',
			'tags',
			'attributes', // Shop Attributes widget
		);

  	/**
  	 * Mfn_Widgets constructor
  	 */

  	public function __construct()
  	{
  		// fires after all default WordPress widgets have been registered.
  		add_action('widgets_init', array($this, 'register'));
  	}

  	/**
  	 * Register new widgets
  	 */

  	public function register()
  	{
			foreach ( $this->widgets as $widget ){

				if($widget == 'attributes' && ( mfn_opts_get('variable-swatches') == 0 || !function_exists('is_woocommerce') ) ){
					continue;
				}

				$widget_class = 'Mfn_Widget_'. ucfirst($widget);

				require_once(get_theme_file_path('/functions/widgets/class-mfn-widget-'. $widget .'.php'));
				register_widget($widget_class);

			}
  	}

  }
}

new Mfn_Widgets();