-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplayground-builder.php
More file actions
60 lines (51 loc) · 1.8 KB
/
Copy pathplayground-builder.php
File metadata and controls
60 lines (51 loc) · 1.8 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
<?php
/**
* Plugin Name: Playground Builder
* Plugin URI: https://github.com/akirk/playground-builder
* Description: Build shareable WordPress Playground links: pick plugins, themes, WordPress and PHP versions, a language and a start page, then copy the link.
* Version: 1.0.0
* Requires at least: 6.0
* Tested up to: 7.1
* Requires PHP: 7.4
* Author: Alex Kirk
* Author URI: https://alex.kirk.at/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: playground-builder
*
* @package Playground_Builder
*/
namespace PlaygroundBuilder;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require_once __DIR__ . '/vendor/autoload.php';
add_action( 'init', function() {
load_plugin_textdomain( 'playground-builder', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
} );
add_action( 'plugins_loaded', function() {
// See https://github.com/akirk/wp-app for documentation.
$app = new \WpApp\WpApp( __DIR__ . '/templates', 'playground-builder', [
// Access control
// 'require_login' => false,
// 'require_capability' => 'read',
// Masterbar
// 'show_masterbar_for_anonymous' => false,
// 'show_wp_logo' => true,
// 'show_site_name' => true,
// 'show_dark_mode_toggle' => false,
// 'clear_admin_bar' => false,
// 'add_app_node' => false,
// App identity
// 'app_name' => 'Playground Builder',
// 'my_apps' => true,
'my_apps_icon' => plugins_url( 'assets/icon.png', __FILE__ ),
] );
$app->init();
} );
register_activation_hook( __FILE__, function() {
flush_rewrite_rules();
} );
register_deactivation_hook( __FILE__, function() {
flush_rewrite_rules();
} );