$18 GRAYBYTE WORDPRESS FILE MANAGER $14

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/cepurhuye.rw/wp-content/plugins/elementor/modules/favorites/types/

HOME
Current File : /home/bravrvjk/cepurhuye.rw/wp-content/plugins/elementor/modules/favorites/types//widgets.php
<?php
namespace Elementor\Modules\Favorites\Types;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

use Elementor\Modules\Favorites\Favorites_Type;
use Elementor\Plugin;

class Widgets extends Favorites_Type {
	const CATEGORY_SLUG = 'favorites';

	/**
	 * Widgets favorites type constructor.
	 */
	public function __construct( array $items = [] ) {
		parent::__construct( $items );

		add_action( 'elementor/document/before_get_config', [ $this, 'update_widget_categories' ], 10, 1 );
	}

	public function get_name() {
		return 'widgets';
	}

	public function prepare( $favorites ) {
		return array_intersect( parent::prepare( $favorites ), $this->get_available() );
	}

	/**
	 * Get all available widgets.
	 *
	 * @return string[]
	 */
	public function get_available() {
		return array_merge(
			array_keys(
				Plugin::instance()->widgets_manager->get_widget_types()
			),
			array_keys(
				Plugin::instance()->elements_manager->get_element_types()
			)
		);
	}

	/**
	 * Update the categories of a widget inside a filter.
	 *
	 * @param $document
	 */
	public function update_widget_categories( $document ) {
		foreach ( $this->values() as $favorite ) {
			$widget = Plugin::$instance->widgets_manager->get_widget_types( $favorite );

			// If it's not a widget, maybe it's an element.
			if ( ! $widget ) {
				$widget = Plugin::$instance->elements_manager->get_element_types( $favorite );
			}

			if ( $widget ) {
				$widget->set_config( 'categories', [ static::CATEGORY_SLUG ] );
			}
		}
	}
}


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
widgets.php
1.491 KB
23 Apr 2023 3.22 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF