Submit
Path:
~
/
home
/
getwphos
/
www
/
pioneerasphalt
/
wp-content
/
plugins
/
qode-framework
/
inc
/
widgets
/
File Content:
class-qodeframeworkwidgets.php
<?php if ( ! defined( 'ABSPATH' ) ) { // Exit if accessed directly. exit; } class QodeFrameworkWidgets { private $widgets; public function __construct() { $this->widgets = array(); add_action( 'widgets_init', array( $this, 'register' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_dashboard_framework_scripts' ), 5 ); // 5 is set to be same permission as Gutenberg plugin have } public function get_widgets() { return $this->widgets; } public function get_widget( $base ) { return $this->widgets[ $base ]; } private function set_widget( QodeFrameworkWidget $widget ) { $key = $widget->get_base(); $this->widgets[ $key ] = $widget; } public function widget_exists( $base ) { return array_key_exists( $base, $this->widgets ); } public function add_widget( QodeFrameworkWidget $widget ) { if ( '' !== $widget->get_base() ) { $this->set_widget( $widget ); return $widget; } return false; } public function register() { do_action( 'qode_framework_action_before_widgets_register' ); foreach ( $this->widgets as $widget ) { $widget->register(); } do_action( 'qode_framework_action_after_widgets_register' ); } public function enqueue_dashboard_framework_scripts( $hook ) { if ( 'widgets.php' === $hook ) { // Widgets css scripts. wp_enqueue_style( 'qode-framework-widgets', QODE_FRAMEWORK_INC_URL_PATH . '/widgets/assets/css/widgets.min.css' ); wp_enqueue_style( 'wp-color-picker' ); // Widgets js scripts. wp_enqueue_script( 'jquery-ui-sortable' ); wp_enqueue_style( 'fonticonpicker', QODE_FRAMEWORK_INC_URL_PATH . '/common/assets/plugins/fonticonpicker/jquery.fonticonpicker.min.css' ); wp_enqueue_script( 'fonticonpicker', QODE_FRAMEWORK_INC_URL_PATH . '/common/assets/plugins/fonticonpicker/jquery.fonticonpicker.min.js', array(), false, true ); wp_enqueue_script( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker-alpha' ); // Hook to include additional scripts before dashboard widgets scripts. do_action( 'qode_framework_action_before_dashboard_widgets_scripts' ); // Main dashboard js scripts. wp_enqueue_script( 'qode-framework-script', QODE_FRAMEWORK_INC_URL_PATH . '/common/assets/js/dashboard.min.js', array( 'jquery' ), false, true ); } } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
assets
---
0755
fields
---
0755
class-qodeframeworkwidget.php
8580 bytes
0644
class-qodeframeworkwidgets.php
2310 bytes
0644
include.php
1032 bytes
0644
N4ST4R_ID | Naxtarrr