PluginProbe
Code Snippets / 3.2.1
Code Snippets v3.2.1
3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 3.0.1 All 64 releases
code-snippets / php / load.php

load.php in Code Snippets 3.2.1, at php/load.php

62 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Initialise and load the plugin under the proper namespace
4 *
5 * @package Code_Snippets
6 */
7
8 namespace Code_Snippets;
9
10 /**
11 * The version number for this release of the plugin.
12 * This will later be used for upgrades and enqueuing files.
13 *
14 * This should be set to the 'Plugin Version' value defined
15 * in the plugin header.
16 *
17 * @var string A PHP-standardized version number string.
18 */
19 const PLUGIN_VERSION = '3.2.1';
20
21 /**
22 * The full path to the main file of this plugin.
23 *
24 * This can later be used with functions such as
25 * plugin_dir_path(), plugins_url() and plugin_basename()
26 * to retrieve information about plugin paths.
27 *
28 * @var string
29 */
30 const PLUGIN_FILE = CODE_SNIPPETS_FILE;
31
32 /**
33 * Name of the group used for caching data.
34 *
35 * @var string
36 */
37 const CACHE_GROUP = 'code_snippets';
38
39 /* Load dependencies with Composer */
40 require_once dirname( __DIR__ ) . '/vendor/autoload.php';
41
42 /**
43 * Retrieve the instance of the main plugin class.
44 *
45 * @since 2.6.0
46 * @return Plugin
47 */
48 function code_snippets() {
49 static $plugin;
50
51 if ( is_null( $plugin ) ) {
52 $plugin = new Plugin( PLUGIN_VERSION, PLUGIN_FILE );
53 }
54
55 return $plugin;
56 }
57
58 code_snippets()->load_plugin();
59
60 /* Execute the snippets once the plugins are loaded */
61 add_action( 'plugins_loaded', __NAMESPACE__ . '\execute_active_snippets', 1 );
62