PluginProbe
Scrollsequence – Cinematic Scroll Image Animation Plugin / 1.0.073
Scrollsequence – Cinematic Scroll Image Animation Plugin v1.0.073
1.4.3 1.4.4 1.4.5 1.4.6 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 trunk 0.9.92 0.9.93 0.9.94 0.9.96 1.0.072 1.0.073 All 61 releases
scrollsequence / includes / class-scrollsequence.php

class-scrollsequence.php in Scrollsequence – Cinematic Scroll Image Animation Plugin 1.0.073, at includes/class-scrollsequence.php

247 lines 7.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The file that defines the core plugin class
5 *
6 * A class definition that includes attributes and functions used across both the
7 * public-facing side of the site and the admin area.
8 *
9 * @link www.scrollsequence.com
10 * @since 0.7.0
11 *
12 * @package Scrollsequence
13 * @subpackage Scrollsequence/includes
14 */
15
16 /**
17 * The core plugin class.
18 *
19 * This is used to define internationalization, admin-specific hooks, and
20 * public-facing site hooks.
21 *
22 * Also maintains the unique identifier of this plugin as well as the current
23 * version of the plugin.
24 *
25 * @since 0.7.0
26 * @package Scrollsequence
27 * @subpackage Scrollsequence/includes
28 * @author Scrollsequence <info@scrollsequence.com>
29 */
30 class Scrollsequence {
31
32 /**
33 * The loader that's responsible for maintaining and registering all hooks that power
34 * the plugin.
35 *
36 * @since 0.7.0
37 * @access protected
38 * @var Scrollsequence_Loader $loader Maintains and registers all hooks for the plugin.
39 */
40 protected $loader;
41
42 /**
43 * The unique identifier of this plugin.
44 *
45 * @since 0.7.0
46 * @access protected
47 * @var string $plugin_name The string used to uniquely identify this plugin.
48 */
49 protected $plugin_name;
50
51 /**
52 * The current version of the plugin.
53 *
54 * @since 0.7.0
55 * @access protected
56 * @var string $version The current version of the plugin.
57 */
58 protected $version;
59
60 /**
61 * Define the core functionality of the plugin.
62 *
63 * Set the plugin name and the plugin version that can be used throughout the plugin.
64 * Load the dependencies, define the locale, and set the hooks for the admin area and
65 * the public-facing side of the site.
66 *
67 * @since 0.7.0
68 */
69 public function __construct() {
70 if ( defined( 'SCROLLSEQUENCE_VERSION' ) ) {
71 $this->version = SCROLLSEQUENCE_VERSION;
72 } else {
73 $this->version = '1.0.0';
74 }
75 $this->plugin_name = 'scrollsequence';
76
77 $this->load_dependencies();
78 $this->set_locale();
79 $this->define_admin_hooks();
80 $this->define_public_hooks();
81
82 }
83
84 /**
85 * Load the required dependencies for this plugin.
86 *
87 * Include the following files that make up the plugin:
88 *
89 * - Scrollsequence_Loader. Orchestrates the hooks of the plugin.
90 * - Scrollsequence_i18n. Defines internationalization functionality.
91 * - Scrollsequence_Admin. Defines all hooks for the admin area.
92 * - Scrollsequence_Public. Defines all hooks for the public side of the site.
93 *
94 * Create an instance of the loader which will be used to register the hooks
95 * with WordPress.
96 *
97 * @since 0.7.0
98 * @access private
99 */
100 private function load_dependencies() {
101
102 /**
103 * The class responsible for orchestrating the actions and filters of the
104 * core plugin.
105 */
106 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-scrollsequence-loader.php';
107
108 /**
109 * The class responsible for defining internationalization functionality
110 * of the plugin.
111 */
112 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-scrollsequence-i18n.php';
113
114 /**
115 * The class responsible for defining all actions that occur in the admin area.
116 */
117 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-scrollsequence-admin.php';
118
119 /**
120 * The class responsible for defining all actions that occur in the public-facing
121 * side of the site.
122 */
123 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-scrollsequence-public.php';
124
125 $this->loader = new Scrollsequence_Loader();
126
127 }
128
129 /**
130 * Define the locale for this plugin for internationalization.
131 *
132 * Uses the Scrollsequence_i18n class in order to set the domain and to register the hook
133 * with WordPress.
134 *
135 * @since 0.7.0
136 * @access private
137 */
138 private function set_locale() {
139
140 $plugin_i18n = new Scrollsequence_i18n();
141
142 $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
143
144 }
145
146 /**
147 * Register all of the hooks related to the admin area functionality
148 * of the plugin.
149 *
150 * @since 0.7.0
151 * @access private
152 */
153 private function define_admin_hooks() {
154
155 $plugin_admin = new Scrollsequence_Admin( $this->get_plugin_name(), $this->get_version() );
156
157 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
158 $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
159 // register scrollsequence CPT
160 $this->loader->add_action( 'init', $plugin_admin, 'scrollsequence_cpt' );
161 // register CPT submenu
162 $this->loader->add_action( 'init', $plugin_admin, 'scrollsequence_cpt_submenu' );
163 // tutplus.com Step 1
164 $this->loader->add_action( 'template_include', $plugin_admin, 'scrollsequence_template' );
165 //Carbon Fields boot
166 $this->loader->add_action( 'after_setup_theme', $plugin_admin, 'scrollsequence_carbon_fields_load' );
167 //Carbon Fields main fields
168 $this->loader->add_action( 'carbon_fields_register_fields', $plugin_admin, 'scrollsequence_carbon_fields_cpt' );
169
170 //admin notice (too many img)
171 $this->loader->add_action( 'admin_notices', $plugin_admin, 'scrollsequence_admin_notice', 10, 2);
172
173 //Classic Content Editor Heading
174 $this->loader->add_action( 'edit_form_after_title', $plugin_admin, 'scrollsequence_classic_content_html', 9999, 2);
175
176 // Admin Columns
177 $this->loader->add_action( 'manage_scrollsequence_posts_columns', $plugin_admin, 'scrollsequence_admin_columns',5 );
178 $this->loader->add_action( 'manage_scrollsequence_posts_custom_column', $plugin_admin, 'scrollsequence_admin_column_content',5,2 );
179
180
181 //BLOCKSTUFF
182 //Carbon Fields block fields
183 //$this->loader->add_action( 'carbon_fields_register_fields', $plugin_admin, 'scrollsequence_carbon_fields_block' );
184
185
186 }
187
188 /**
189 * Register all of the hooks related to the public-facing functionality
190 * of the plugin.
191 *
192 * @since 0.7.0
193 * @access private
194 */
195 private function define_public_hooks() {
196
197 $plugin_public = new Scrollsequence_Public( $this->get_plugin_name(), $this->get_version() );
198
199 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
200 $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
201
202
203
204 }
205
206 /**
207 * Run the loader to execute all of the hooks with WordPress.
208 *
209 * @since 0.7.0
210 */
211 public function run() {
212 $this->loader->run();
213 }
214
215 /**
216 * The name of the plugin used to uniquely identify it within the context of
217 * WordPress and to define internationalization functionality.
218 *
219 * @since 0.7.0
220 * @return string The name of the plugin.
221 */
222 public function get_plugin_name() {
223 return $this->plugin_name;
224 }
225
226 /**
227 * The reference to the class that orchestrates the hooks with the plugin.
228 *
229 * @since 0.7.0
230 * @return Scrollsequence_Loader Orchestrates the hooks of the plugin.
231 */
232 public function get_loader() {
233 return $this->loader;
234 }
235
236 /**
237 * Retrieve the version number of the plugin.
238 *
239 * @since 0.7.0
240 * @return string The version number of the plugin.
241 */
242 public function get_version() {
243 return $this->version;
244 }
245
246 }
247