Start
This commit is contained in:
60
romhackplaza.php
Executable file
60
romhackplaza.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: RomhackPlaza Plugin
|
||||
* Plugin URI: https://example.com
|
||||
* Description: Plugin created for the Romhack Plaza website.
|
||||
* Version: 0.0.1a
|
||||
* Requires at least: 6.8
|
||||
* Requires PHP: 8.5
|
||||
* Author: Benjamin, Spike (Original)
|
||||
* License: GPL v2 or later
|
||||
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
* Update URI: https://example.com/my-plugin/
|
||||
* Text Domain: romhackplaza
|
||||
* Domain path: /languages
|
||||
* Requires Plugins: advanced-custom-fields-pro
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
require_once __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
function _romhackplaza_define_constants() {
|
||||
|
||||
if( !defined( 'ROMHACKPLAZA' ) )
|
||||
define( 'ROMHACKPLAZA', '0.0.1' );
|
||||
|
||||
if( !defined( 'ROMHACKPLAZA_PLUGIN_URI' ) )
|
||||
define( 'ROMHACKPLAZA_PLUGIN_URI', plugin_dir_url( __FILE__ ) );
|
||||
|
||||
if( !defined( 'ROMHACKPLAZA_PLUGIN_DIR' ) )
|
||||
define( 'ROMHACKPLAZA_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
|
||||
|
||||
}
|
||||
|
||||
function _romhackplaza_read_env() {
|
||||
|
||||
$dotenv = Dotenv\Dotenv::createImmutable( __DIR__ );
|
||||
$dotenv->load();
|
||||
|
||||
}
|
||||
|
||||
function _romhackplaza_plugin_activate() {
|
||||
|
||||
// Verify tables.
|
||||
\RomhackPlaza\Extenders\Post\Hashes_Table::verify_table();
|
||||
\RomhackPlaza\Extenders\User_Notifications::verify_table();
|
||||
|
||||
}
|
||||
|
||||
_romhackplaza_define_constants();
|
||||
_romhackplaza_read_env();
|
||||
|
||||
register_activation_hook( __FILE__, '_romhackplaza_plugin_activate' );
|
||||
|
||||
use RomhackPlaza\Plugin;
|
||||
|
||||
$_romhackplaza = new Plugin()
|
||||
->setup_extenders_direct();
|
||||
|
||||
do_action( 'RomhackPlaza\\Init' );
|
||||
Reference in New Issue
Block a user