<?php


/**
 * Register new Elementor widgets.
 *
 * @param \Elementor\Widgets_Manager $widgets_manager Elementor widgets manager.
 * @return void
 */
function register_new_widgets( $widgets_manager ) {

	    				if ( is_plugin_active( 'elementor/elementor.php' ) ) {
/* single product */
		require_once('single-product/widget-image.php');
		require_once('single-product/widget-zemanat.php');
		require_once('single-product/widget-add.php');
		require_once('single-product/widget-dokan.php');
		require_once('single-product/widget-time.php');
		require_once('single-product/widget-english.php');
		require_once('single-product/widget-easy.php');
		require_once('single-product/widget-sale.php');
		require_once('single-product/widget-joz.php');
		require_once('single-product/widget-bar.php');
		require_once('single-product/widget-short.php');
		require_once('single-product/widget-tab.php');
		require_once('single-product/widget-related.php');
		require_once('single-product/widget-meta.php');
		require_once('single-product/widget-offer.php');
		require_once('single-product/widget-emtiaz.php');
		require_once('single-product/widget-timer.php');
		require_once('single-product/widget-star.php');
		require_once('single-product/widget-catalog.php');
		require_once('single-product/widget-bread.php');
		require_once('single-product/widget-product.php');

		require_once('single-product/widget-box.php');
		
		
		

		require_once( __DIR__ . '/widget-product-off.php');


		require_once( __DIR__ . '/widget-product-off.php');
		require_once( __DIR__ . '/widget-product-offer.php');
		require_once( __DIR__ . '/widget-product-offer-two.php');
        require_once( __DIR__ . '/widget-product-offer-three.php');
	   	require_once( __DIR__ . '/widget-product-koffer.php');
		require_once( __DIR__ . '/widget-product-one.php');
		require_once( __DIR__ . '/widget-product-lahze.php');
		require_once( __DIR__ . '/widget-product-two.php');
		require_once( __DIR__ . '/widget-product-three.php');
		require_once( __DIR__ . '/widget-product-five.php');
		require_once( __DIR__ . '/widget-product-four.php');
		require_once( __DIR__ . '/widget-product-k.php');
		require_once( __DIR__ . '/widget-product-klist.php');
		require_once( __DIR__ . '/widget-product-seven.php');
		require_once( __DIR__ . '/widget-product-8.php');
		require_once( __DIR__ . '/widget-product-9.php');
		require_once( __DIR__ . '/widget-product-10.php');
		require_once( __DIR__ . '/widget-user.php');
		require_once( __DIR__ . '/widget-search.php');
		require_once( __DIR__ . '/widget-catagory.php');
		require_once( __DIR__ . '/widget-catagory-two.php');
		require_once( __DIR__ . '/widget-catagory-four.php');
		require_once( __DIR__ . '/widget-post.php');
		require_once( __DIR__ . '/widget-post-two.php');
		require_once( __DIR__ . '/widget-post-one.php');
		require_once( __DIR__ . '/widget-cat.php');
		require_once( __DIR__ . '/widget-joda.php');
		require_once( __DIR__ . '/widget-product-four.php');
		require_once( __DIR__ . '/widget-footer-one.php');
		require_once( __DIR__ . '/widget-header-one.php');
		require_once( __DIR__ . '/widget-header-two.php');
		require_once( __DIR__ . '/widget-header-three.php');
		require_once( __DIR__ . '/widget-header-four.php');
		require_once( __DIR__ . '/widget-header-five.php');
		require_once( __DIR__ . '/widget-header-six.php');
		require_once( __DIR__ . '/widget-product-five.php');
		require_once( __DIR__ . '/widget-header-menu.php');
		
	/*1.1.6 */
	
	   require_once( __DIR__ . '/blog/widget-blog.php');
		require_once( __DIR__ . '/blog/widget-blog-two.php');
		require_once( __DIR__ . '/blog/widget-blog-three.php');
				require_once( __DIR__ . '/mobile/widget-mobile.php');




		/* header element */

	$widgets_manager->register( new \Elementor\poff() );
		$widgets_manager->register( new \Elementor\poff1() );
		$widgets_manager->register( new \Elementor\poff2() );
		$widgets_manager->register( new \Elementor\offer1() );
		$widgets_manager->register( new \Elementor\lahze() );
		$widgets_manager->register( new \Elementor\pone() );
		$widgets_manager->register( new \Elementor\pone1() );
		$widgets_manager->register( new \Elementor\ponefive() );
		$widgets_manager->register( new \Elementor\ponefive() );
		$widgets_manager->register( new \Elementor\ponek() );
		$widgets_manager->register( new \Elementor\poneklist() );
		$widgets_manager->register( new \Elementor\pone7() );
		$widgets_manager->register( new \Elementor\pone10() );
		$widgets_manager->register( new \Elementor\pone11() );
		$widgets_manager->register( new \Elementor\pone12() );
		$widgets_manager->register( new \Elementor\ponefive() );
		$widgets_manager->register( new \Elementor\pone11() );
		$widgets_manager->register( new \Elementor\daste() );
		$widgets_manager->register( new \Elementor\wp1() );
		$widgets_manager->register( new \Elementor\wpp1() );
		$widgets_manager->register( new \Elementor\cat1() );
		$widgets_manager->register( new \Elementor\posttwo() );
		$widgets_manager->register( new \Elementor\pone6() );
		$widgets_manager->register( new \Elementor\pone9() );
		$widgets_manager->register( new \Elementor\joda() );
		$widgets_manager->register( new \Elementor\search1() );
		$widgets_manager->register( new \Elementor\wcategory() );
		$widgets_manager->register( new \Elementor\wcategorytwo() );
        $widgets_manager->register( new \Elementor\footerone() );
		$widgets_manager->register( new \Elementor\headerone() );
		$widgets_manager->register( new \Elementor\headertwo() );
		$widgets_manager->register( new \Elementor\headerthree() );
		$widgets_manager->register( new \Elementor\headerfour() );
		$widgets_manager->register( new \Elementor\headerfive() );
		$widgets_manager->register( new \Elementor\headersix() );
		$widgets_manager->register( new \Elementor\headerthree1() );
				$widgets_manager->register( new \Elementor\blogone() );
		$widgets_manager->register( new \Elementor\blogtwo() );
		$widgets_manager->register( new \Elementor\blogthree() );
				$widgets_manager->register( new \Elementor\mobilebar() );


/* single product */
								$widgets_manager->register( new \Elementor\imagesingle() );
								$widgets_manager->register( new \Elementor\zemanatsingle() );
								$widgets_manager->register( new \Elementor\addsingle() );
								$widgets_manager->register( new \Elementor\dokancatalog() );
								$widgets_manager->register( new \Elementor\timesingle() );
								$widgets_manager->register( new \Elementor\engishsingle() );
								$widgets_manager->register( new \Elementor\easysingle() );
								$widgets_manager->register( new \Elementor\salesingle() );
								$widgets_manager->register( new \Elementor\jozsingle() );
								$widgets_manager->register( new \Elementor\barsingle() );
								$widgets_manager->register( new \Elementor\shortsingle() );
								$widgets_manager->register( new \Elementor\tabsingle() );
								$widgets_manager->register( new \Elementor\relatedsingle() );
								$widgets_manager->register( new \Elementor\metasingle() );
								$widgets_manager->register( new \Elementor\offersingle() );
								$widgets_manager->register( new \Elementor\emtiazproduct() );
								$widgets_manager->register( new \Elementor\timersingle() );
								$widgets_manager->register( new \Elementor\starsingle() );
								$widgets_manager->register( new \Elementor\catalogsingle() );
								$widgets_manager->register( new \Elementor\breadsingle() );
								$widgets_manager->register( new \Elementor\productsingle() );

								$widgets_manager->register( new \Elementor\boxsingle() );
								


}
	}
add_action( 'elementor/widgets/register', 'register_new_widgets' );





function add_elementor_widget_categories( $elements_manager ) {
	
    $categories = [];
    $categories['farnam'] =
        [
            'title' => 'المان های فرنام',
            'icon'  => 'fa fa-plug'
        ];
$categories['farnamproduct'] =
        [
            'title' => 'المان صفحه محصول فرنام',
            'icon'  => 'fa fa-plug'
        ];

    $old_categories = $elements_manager->get_categories();
    $categories = array_merge($categories, $old_categories);

    $set_categories = function ( $categories ) {
        $this->categories = $categories;
    };

    $set_categories->call( $elements_manager, $categories );

}

add_action( 'elementor/elements/categories_registered', 'add_elementor_widget_categories') ;


