Repository navigation
Expand file tree
/
Copy path4wp-bundle.php
More file actions
53 lines (47 loc) · 1.67 KB
/
Copy path4wp-bundle.php
File metadata and controls
53 lines (47 loc) · 1.67 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
<?php
/**
* Plugin Name: 4WP Bundle
* Description: Core bundle to support and manage 4WP Blocks ecosystem.
* Tags: core, bundle, 4wp, blocks
* Version: 1.1.0
* Author: 4wp.dev
* Author URI: https://4wp.dev
* Text Domain: 4wp-bundle
* Domain Path: /languages
* Requires at least: 5.0
* Tested up to: 6.4
* Requires PHP: 7.4
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Network: false
*/
namespace Forwp\Bundle;
class Menu {
}
// Prevent direct access
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Load plugin textdomain for translations
add_action('plugins_loaded', function() {
load_plugin_textdomain(
'4wp-bundle',
false,
dirname(plugin_basename(__FILE__)) . '/languages'
);
});
require_once plugin_dir_path(__FILE__) . 'inc/admin-menu.php';
require_once plugin_dir_path(__FILE__) . 'inc/rest-api.php';
require_once plugin_dir_path(__FILE__) . 'inc/addons.php';
require_once plugin_dir_path(__FILE__) . 'inc/addons-admin.php';
add_action('admin_notices', function() {
// Check if plugin is in a folder with -main in its name
// This is to ensure compatibility with the 4WP Bundle plugin structure
// If the plugin is installed in a folder named "4wp-bundle-main", we recommend renaming it to "4wp-bundle" for best compatibility.
$plugin_dir = basename(dirname(__FILE__));
if (strpos($plugin_dir, '4wp-bundle-main') === 0) {
echo '<div class="notice notice-warning"><p>';
echo esc_html__('4WP Bundle is installed in a folder with "-main" in its name. For best compatibility, please rename the folder to "4wp-bundle".', '4wp-bundle');
echo '</p></div>';
}
});