Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.80.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : Manager.php
<?php

namespace WeDevs\Dokan\Widgets;

use WeDevs\Dokan\Traits\ChainableContainer;

class Manager {

    use ChainableContainer;

    /**
     * Class constructor
     *
     * @since 3.0.0
     *
     * @return void
     */
    public function __construct() {
        $dokan_widgets = apply_filters(
            'dokan_widgets', [
				'best_selling_products' => 'WeDevs\Dokan\Widgets\BestSellingProducts',
				'product_category_menu' => 'WeDevs\Dokan\Widgets\ProductCategoryMenu',
				'store_contact_form'    => 'WeDevs\Dokan\Widgets\StoreContactForm',
				'store_location'        => 'WeDevs\Dokan\Widgets\StoreLocation',
				'store_category_menu'   => 'WeDevs\Dokan\Widgets\StoreCategoryMenu',
				'toprated_products'     => 'WeDevs\Dokan\Widgets\TopratedProducts',
				'store_open_close'      => 'WeDevs\Dokan\Widgets\StoreOpenClose',
				'filter_by_attribute'   => 'WeDevs\Dokan\Widgets\FilterByAttributes',
			]
        );

        foreach ( $dokan_widgets as $widget_id => $widget_class ) {
            register_widget( $widget_class );
        }

        $this->container = $dokan_widgets;
    }

    /**
     * Check if widget class exists
     *
     * @since 3.0.0
     *
     * @param string $widget_id
     *
     * @return bool
     */
    public function is_exists( $widget_id ) {
        return isset( $this->container[ $widget_id ] ) && class_exists( $this->container[ $widget_id ] );
    }

    /**
     * Get widget id from widget class
     *
     * @since 3.0.0
     *
     * @param string $widget_class
     *
     * @return bool|string Returns widget id if found, outherwise returns false
     */
    public function get_id( $widget_class ) {
        return array_search( $widget_class, $this->container, true );
    }
}
© 2025 XylotrechusZ