-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.php
More file actions
51 lines (46 loc) · 1.61 KB
/
bootstrap.php
File metadata and controls
51 lines (46 loc) · 1.61 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
/**
* Cookbook bootstrap.
* This file controls which recipes are loaded. Comment out any `require` below
* to disable that example. Each recipe is independent. You can enable just
* one or all of them, in any combination.
* All recipes register their Data Sources under the shared top-level admin
* menu "DS Cookbook" so the WordPress sidebar stays tidy.
*/
declare(strict_types=1);
if ( ! defined('ABSPATH')) {
exit;
}
/*
* Register the top-level admin menu that all recipes attach to.
*
* We register an empty page here. Each recipe calls `set_submenu('…', 'ac-ds-cookbook')`
* on its Entry so WordPress places the page underneath this parent.
*/
add_action('admin_menu', static function (): void {
add_menu_page(
'Datasources',
'Datasources',
'manage_options',
'ac-ds-cookbook',
'__return_empty_string',
'dashicons-book-alt',
25
);
});
/*
* Enable or disable recipes by (un)commenting the lines below.
*
* The recipes are ordered from simplest to most advanced. If you are new to
* Data Sources, start at the top and work your way down.
*/
require __DIR__ . '/examples/01-simple-users/example.php';
require __DIR__ . '/examples/02-readable-labels/example.php';
require __DIR__ . '/examples/03-defined-columns/example.php';
require __DIR__ . '/examples/04-table-relation/example.php';
/*
* Examples that depend on a third-party plugin guard themselves with a
* `class_exists()` / `function_exists()` check at the top of the file, so
* they no-op silently when the plugin is inactive.
*/
require __DIR__ . '/examples/05-wc-orders/example.php';