PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / wordpress / abilities-api / includes / bootstrap.php
ameliabooking / vendor / wordpress / abilities-api / includes Last commit date
abilities 1 month ago abilities-api 1 month ago assets 1 month ago rest-api 1 month ago abilities-api.php 1 month ago bootstrap.php 1 month ago
bootstrap.php
78 lines
1 <?php
2 /**
3 * Bootstraps the Abilities API classes and global functions.
4 *
5 * This file is autoloaded by Composer when the package is installed via the
6 * "files" autoload mechanism. It ensures the procedural functions defined in
7 * `includes/abilities-api.php` are available without requiring namespaces.
8 *
9 * @package WordPress
10 * @subpackage Abilities_API
11 * @since 0.1.0
12 */
13
14 declare( strict_types = 1 );
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 return; // Not in WordPress context
18 }
19
20 // Version of the plugin.
21 if ( ! defined( 'WP_ABILITIES_API_VERSION' ) ) {
22 define( 'WP_ABILITIES_API_VERSION', '0.4.0' );
23 }
24
25 // Load core classes if they are not already defined (for non-Composer installs or direct includes).
26 if ( ! class_exists( 'WP_Ability_Category' ) ) {
27 require_once __DIR__ . '/abilities-api/class-wp-ability-category.php';
28 }
29 if ( ! class_exists( 'WP_Ability_Categories_Registry' ) ) {
30 require_once __DIR__ . '/abilities-api/class-wp-ability-categories-registry.php';
31 }
32 if ( ! class_exists( 'WP_Ability' ) ) {
33 require_once __DIR__ . '/abilities-api/class-wp-ability.php';
34 }
35 if ( ! class_exists( 'WP_Abilities_Registry' ) ) {
36 require_once __DIR__ . '/abilities-api/class-wp-abilities-registry.php';
37 }
38
39 // Ensure procedural functions are available, too.
40 if ( ! function_exists( 'wp_register_ability' ) ) {
41 require_once __DIR__ . '/abilities-api.php';
42 }
43
44 // Load core abilities registration functions.
45 if ( ! function_exists( 'wp_register_core_abilities' ) ) {
46 require_once __DIR__ . '/abilities/wp-core-abilities.php';
47 }
48
49 // Register core abilities category and abilities when requested via filter or when not in test environment.
50 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Plugin-specific hook for feature plugin context.
51 if ( ! ( defined( 'WP_RUN_CORE_TESTS' ) || defined( 'WP_TESTS_CONFIG_FILE_PATH' ) || ( function_exists( 'getenv' ) && false !== getenv( 'WP_PHPUNIT__DIR' ) ) ) || apply_filters( 'abilities_api_register_core_abilities', false ) ) {
52 if ( function_exists( 'add_action' ) ) {
53 add_action( 'wp_abilities_api_categories_init', 'wp_register_core_ability_categories' );
54 add_action( 'wp_abilities_api_init', 'wp_register_core_abilities' );
55 }
56 }
57
58 // Load REST API init class for plugin bootstrap.
59 if ( ! class_exists( 'WP_REST_Abilities_Init' ) ) {
60 require_once __DIR__ . '/rest-api/class-wp-rest-abilities-init.php';
61
62 // Initialize REST API routes when WordPress is available.
63 if ( function_exists( 'add_action' ) ) {
64 add_action( 'rest_api_init', array( 'WP_REST_Abilities_Init', 'register_routes' ), 11 );
65 }
66 }
67
68 // Load assets init class for plugin bootstrap.
69 if ( ! class_exists( 'WP_Abilities_Assets_Init' ) ) {
70 require_once __DIR__ . '/assets/class-wp-abilities-assets-init.php';
71
72 // Initialize client assets when WordPress is available.
73 if ( function_exists( 'add_action' ) ) {
74 add_action( 'init', array( 'WP_Abilities_Assets_Init', 'register_assets' ) );
75 add_action( 'admin_enqueue_scripts', array( 'WP_Abilities_Assets_Init', 'admin_enqueue_scripts' ) );
76 }
77 }
78