-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
38 lines (35 loc) · 1.07 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* WordPress Widget
*
* Develop WordPress widgets based on Amarkal UI.
* This is a component within the Amarkal framework.
*
* @package amarkal-widget
* @depends amarkal-ui
* @author Askupa Software <hello@askupasoftware.com>
* @link https://github.com/amarkal/amarkal-widget
* @copyright 2017 Askupa Software
*/
// Prevent direct file access
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/**
* Prevent loading the library more than once
*/
if( defined( 'AMARKAL_WIDGET' ) ) return false;
define( 'AMARKAL_WIDGET', true );
if(!function_exists('amarkal_widget_assets'))
{
/**
* Print widget styles
*/
function amarkal_widget_scripts( $hook )
{
if( 'widgets.php' === $hook )
{
\wp_enqueue_style('amarkal-widget',\Amarkal\Core\Utility::path_to_url(__DIR__.'/widget.css'));
\wp_enqueue_script('amarkal-widget',\Amarkal\Core\Utility::path_to_url(__DIR__.'/widget.js'),array('jquery','amarkal-ui'));
}
}
add_action('admin_enqueue_scripts', 'amarkal_widget_scripts');
}