-
Notifications
You must be signed in to change notification settings - Fork 1
/
class-snap-scroll-admin.php
85 lines (72 loc) · 1.94 KB
/
class-snap-scroll-admin.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/*
* @package Wicked Snap Scroll
* @author Engage Inc
* @link http://snapscroll.engagefb.com/
* Description: Our Wicked Snap Scroll for Wordpress plugin allows you to define 'anchor points' into which the window snaps when you scroll through a webpage.
* Version: 1.0.0
* Author: Engage Inc
* Author URI: http://en.gg
* Copyright: Engage Inc.
*/
class Snap_Scroll_Admin {
/**
* Instance of this class.
*
* @since 1.0.0
*
* @var object
*/
protected static $instance = null;
/**
* Slug of the plugin screen.
*
* @since 1.0.0
*
* @var string
*/
protected $plugin_screen_hook_suffix = null;
/**
* Initialize the plugin by loading admin scripts & styles and adding a
* settings page and menu.
*
* @since 1.0.0
*/
private function __construct() {
/*
* Call $plugin_slug from public plugin class.
*
* TODO:
*
* - Rename "Plugin_Name" to the name of your initial plugin class
*
*/
$plugin = Snap_Scroll::get_instance();
$this->plugin_slug = $plugin->get_plugin_slug();
// Load admin style sheet and JavaScript.
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
/*
* Define custom functionality.
*
* Read more about actions and filters:
* http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters
*/
add_action( 'TODO', array( $this, 'action_method_name' ) );
add_filter( 'TODO', array( $this, 'filter_method_name' ) );
}
/**
* Return an instance of this class.
*
* @since 1.0.0
*
* @return object A single instance of this class.
*/
public static function get_instance() {
// If the single instance hasn't been set, set it now.
if ( null == self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
}