Skip to content

Commit 71c0ca9

Browse files
committed
Setup plugin base
1 parent ee867e5 commit 71c0ca9

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

index.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?php // Silence is golden

saltus-framework.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
* Saltus Framework
4+
*
5+
* @wordpress-plugin
6+
* Plugin Name: Saltus Framework
7+
* Plugin URI: https://saltus.io/
8+
* Description: Saltus Plugin Framework.
9+
* Version: 0.0.1
10+
* Author: Saltus
11+
* Author URI: https://saltus.io/
12+
* License: GPL-2.0+
13+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
14+
* Text Domain: saltus-framework
15+
* Domain Path: /languages
16+
*/
17+
18+
namespace Saltus\WP\Plugin\Saltus\PluginFramework;
19+
20+
use Saltus\WP\Plugin\Saltus\Framework;
21+
22+
// If this file is called directly, quit.
23+
if ( ! defined( 'WPINC' ) ) {
24+
exit;
25+
}
26+
27+
if ( file_exists( dirname( __FILE__ ) . '/lib/autoload.php' ) ) {
28+
require_once dirname( __FILE__ ) . '/lib/autoload.php';
29+
}
30+
31+
if ( ! class_exists( Framework\Core::class ) ) {
32+
exit;
33+
}
34+
35+
/*
36+
* The path to the plugin root directory is mandatory,
37+
* so it loads the models from a subdirectory.
38+
*/
39+
$framework = new Framework\Core( dirname( __FILE__ ) );
40+
41+
/**
42+
* Initialize plugin
43+
*
44+
*/
45+
add_action(
46+
'plugins_loaded',
47+
function ( $framework ) {
48+
$plugin = new Core( 'saltus-framework', '0.0.1', __FILE__, $framework );
49+
$plugin->init();
50+
}
51+
);
52+

0 commit comments

Comments
 (0)