-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatonic-framework.php
More file actions
77 lines (65 loc) · 2.32 KB
/
platonic-framework.php
File metadata and controls
77 lines (65 loc) · 2.32 KB
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
<?php
/**
* Platonic Framework
*
* @package Platonic\Framework
* @author Gerard Reches
* @copyright Copyright (c) 2021, Gerard Reches Urbano
* @license GPL v3.0
*
* @wordpress-plugin
* Plugin Name: Platonic Framework
* Plugin URI: https://gerardreches.com
* Description: WordPress Framework for the Settings API and Customizer API
* Version: 2.0.0
* Requires at least: 5.2
* Requires PHP: 8.2
* Author: Gerard Reches
* Author URI: https://gerardreches.com
* Text Domain: platonic-framework
* License: GPL v3.0
* License URI: https://www.gnu.org/licenses/gpl-3.0.txt
* GitHub Plugin URI: gerardreches/platonic-framework
* GitHub Plugin URI: https://github.com/gerardreches/platonic-framework
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// No need to proceed if Platonic already exists.
if ( class_exists( \Platonic\Framework\Settings\Settings_Page::class ) ) {
return;
}
if ( ! defined( 'PLATONIC_FRAMEWORK_PLUGIN_DIR' ) ) {
define( 'PLATONIC_FRAMEWORK_PLUGIN_DIR', __DIR__ );
}
if ( ! defined( 'PLATONIC_FRAMEWORK_PLUGIN_FILE' ) ) {
define( 'PLATONIC_FRAMEWORK_PLUGIN_FILE', __FILE__ );
}
if ( ! defined( 'PLATONIC_FRAMEWORK_PLUGIN_BASENAME' ) ) {
define( 'PLATONIC_FRAMEWORK_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
}
if ( ! defined( 'PLATONIC_FRAMEWORK_DEBUG_MODE' ) ) {
define( 'PLATONIC_FRAMEWORK_DEBUG_MODE', false );
}
function platonic_framework_load_textdomain(): void {
load_plugin_textdomain(
'platonic-framework',
false,
trailingslashit( dirname( PLATONIC_FRAMEWORK_PLUGIN_BASENAME ) ) . 'languages/'
);
}
add_action( 'init', 'platonic_framework_load_textdomain' );
require_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'lib/autoload.php' );
/**
* Receive updates from GitHub.
*/
function platonic_framework_check_for_updates(): void {
require_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'lib/plugin-update-checker-5.6/plugin-update-checker.php' );
$myUpdateChecker = YahnisElsts\PluginUpdateChecker\v5\PucFactory::buildUpdateChecker(
'https://github.com/gerardreches/platonic-framework',
PLATONIC_FRAMEWORK_PLUGIN_FILE,
'platonic-framework'
);
}
add_action( 'admin_init', 'platonic_framework_check_for_updates' );