-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetlist-player.php
More file actions
51 lines (45 loc) · 1.73 KB
/
setlist-player.php
File metadata and controls
51 lines (45 loc) · 1.73 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
<?php
/**
* Plugin Name: Setlist Player
* Plugin URI: https://github.com/ironprogrammer/setlist-player
* Description: A plugin to create and display practice setlists.
* Author: ironprogrammer
* Author URI: https://brianalexander.com
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: setlist-player
* Version: 0.1.0
* Requires at least: 6.1
* Tested up to: 6.8
* Requires PHP: 7.4
*
* @package Setlist_Player
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Define plugin constants.
define( 'SETLIST_PLAYER_VERSION', '0.1.0' );
define( 'SETLIST_PLAYER_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'SETLIST_PLAYER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'SETLIST_PLAYER_PLUGIN_FILE', __FILE__ );
// Load dependencies.
require_once SETLIST_PLAYER_PLUGIN_DIR . 'includes/class-setlist-player-youtube-api.php';
require_once SETLIST_PLAYER_PLUGIN_DIR . 'includes/class-setlist-player-settings.php';
require_once SETLIST_PLAYER_PLUGIN_DIR . 'includes/class-setlist-player-rest-controller.php';
require_once SETLIST_PLAYER_PLUGIN_DIR . 'includes/class-setlist-player-block.php';
// Initialize settings page.
$setlist_player_settings = new Setlist_Player_Settings();
add_action( 'admin_menu', array( $setlist_player_settings, 'add_settings_page' ) );
add_action( 'admin_init', array( $setlist_player_settings, 'register_settings' ) );
// Initialize REST API.
add_action(
'rest_api_init',
function () {
$controller = new Setlist_Player_REST_Controller();
$controller->register_routes();
}
);
// Initialize block.
$setlist_player_block = new Setlist_Player_Block();