/
custom-frontend-notices.php
55 lines (42 loc) · 1.17 KB
/
custom-frontend-notices.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/*
Plugin Name: Custom Frontend Notices
Description: Allows users to add and manage custom notices for the frontend of their sites.
Version: 0.0.6
Author: Kenny Hall
Author URI: http://kennyinthewild.com
*/
/**
* Class Custom_Frontend_Notices
*/
class Custom_Frontend_Notices
{
/**
* @var string
*/
public static $url = '';
/**
* @var string
*/
public static $dir = '';
/**
* Custom_Frontend_Notices constructor.
*/
public function __construct()
{
include( 'includes/admin/cfn-post-type.php' );
include( 'includes/cfn-settings.php' );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueueScripts' ), 9001 );
self::$dir = plugin_dir_path( __FILE__ );
self::$url = plugin_dir_url( __FILE__ );
}
public function enqueueScripts()
{
$handle = 'cfn_script';
$src = Custom_Frontend_Notices::$url . 'includes/js/cfn-css-selector.js';
$deps = array( 'jquery' );
wp_register_script( $handle, $src, $deps, false, true );
wp_enqueue_script( 'cfn_script' );
}
}
return new Custom_Frontend_Notices();