PluginProbe
Core Framework / 1.9.3
Core Framework v1.9.3
2.0.2 2.0.1 2.0.0 1.10.4 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.3.10 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.1.1 1.5.2 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.8.0 All 32 releases
core-framework / core-framework.php

core-framework.php in Core Framework 1.9.3, at core-framework.php

127 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @package CoreFramework
5 * @author Core Framework <hello@coreframework.com>
6 * @copyright 2023 Core Framework
7 * @license EULA + GPLv2
8 * @link https://coreframework.com
9 *
10 * Plugin Name: Core Framework
11 * Plugin URI: https://coreframework.com
12 * Description: The CORE of your website
13 * Version: 1.9.3
14 * Author: Core Framework
15 * Author URI: https://coreframework.com
16 * Text Domain: core-framework
17 * Domain Path: /languages
18 * License: GPLv2
19 * License URI: https://coreframework.com/eula + https://www.gnu.org/licenses/gpl-2.0.html
20 * Requires PHP: 7.4
21 * Requires WP: 6.0
22 * Namespace: CoreFramework
23 */
24
25 declare(strict_types=1);
26
27 use CoreFramework\Common\Functions;
28 use CoreFramework\Config\Setup;
29 use CoreFramework\Scaffold;
30
31 if ( ! defined( 'ABSPATH' ) ) {
32 exit();
33 }
34
35 define( 'CORE_FRAMEWORK_ABSOLUTE', __FILE__ );
36 define( 'CORE_FRAMEWORK_MAIN_FILE', plugin_basename( __FILE__ ) );
37 define( 'CORE_FRAMEWORK_DIR_ROOT', plugin_dir_path( __FILE__ ) );
38 define( 'CORE_FRAMEWORK_DIR_URL', plugin_dir_url( __FILE__ ) );
39
40 define( 'CORE_FRAMEWORK_NAME', dirname( CORE_FRAMEWORK_MAIN_FILE ) );
41
42 define( 'CORE_FRAMEWORK_DB_VER', '1.3' );
43 define( 'CORE_FRAMEWORK_VERSION', '1.9.3' );
44
45 define( 'CORE_FRAMEWORK_EDD_STORE_URL', 'https://edd.coreframework.com' );
46 define( 'CORE_FRAMEWORK_FREE_ITEM_ID', 40 );
47
48 define( 'CORE_FRAMEWORK_ASSETS_PREFIX', 'core-framework/core-framework/' );
49
50 $core_framework_autoloader = require CORE_FRAMEWORK_DIR_ROOT . 'vendor/autoload.php';
51
52 if ( ! wp_installing() ) {
53 register_activation_hook( __FILE__, array( Setup::class, 'activation' ) );
54 register_deactivation_hook( __FILE__, array( Setup::class, 'deactivation' ) );
55 register_uninstall_hook( __FILE__, array( Setup::class, 'uninstall' ) );
56
57 add_action( 'admin_init', array( Setup::class, 'on_plugin_update_completed' ), 10, 2 );
58 }
59
60 if ( ! class_exists( '\\' . Scaffold::class ) ) {
61 wp_die( __( 'Core Framework is unable to find the Scaffold class.', 'core-framework' ) );
62 }
63
64 add_action(
65 'plugins_loaded',
66 function () use ( $core_framework_autoloader ): void {
67 try {
68 new Scaffold( $core_framework_autoloader );
69 } catch ( Exception $e ) {
70 wp_die( __( 'Core Framework is unable to run the Scaffold class.', 'core-framework' ) );
71 }
72 }
73 );
74
75 add_action( 'wp_initialize_site', array( Setup::class, 'on_new_multi_site_blog' ), 999, 2 );
76 add_action( 'admin_notices', 'core_framework_update_notices' );
77
78 function core_framework_update_notices(){
79 if( get_transient( 'core-framework-update-notice' ) ){
80 ?>
81 <div class="updated notice is-dismissible">
82 <p>Core Framework has been installed. Please save changes in Core Framework plugin to update your stylesheet.</p>
83 </div>
84 <?php
85 delete_transient( 'core-framework-update-notice' );
86 }
87 }
88
89 /**
90 * Create a main function for external uses
91 *
92 * @return Functions
93 * @since 0.0.0
94 */
95 function CoreFramework(): Functions {
96 return new Functions();
97 }
98
99 /**
100 * Create a Oxygen function for external uses
101 *
102 * @since 0.0.0
103 */
104 function CoreFrameworkOxygen(): \CoreFramework\App\Oxygen\Functions {
105 return new \CoreFramework\App\Oxygen\Functions();
106 }
107
108 /**
109 * Create a Bricks function for external uses
110 *
111 * @since 0.0.1
112 */
113 function CoreFrameworkBricks(): \CoreFramework\App\Bricks\Functions {
114 return new \CoreFramework\App\Bricks\Functions();
115 }
116
117 /**
118 * Create a Gutenberg function for external uses
119 *
120 * @since 1.0.0
121 */
122 function CoreFrameworkGutenberg(): \CoreFramework\App\Gutenberg\Functions {
123 return new \CoreFramework\App\Gutenberg\Functions();
124 }
125
126 CoreFrameworkGutenberg()->init();
127