-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
71 lines (60 loc) · 2.01 KB
/
main.php
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
61
62
63
64
65
66
67
68
69
70
71
<?php
namespace RGBTeamMembers;
/**
* Plugin Name: Team Members
* Plugin URI: https://github.com/redgreenbird-media/wordpress-team-members
* Description: This Plugin handles all Team Members.
* Version: 1.0.2
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: redgreenbird GmbH
* Author URI: https://redgreenbird.com
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Update URI: https://github.com/redgreenbird-media/wordpress-team-members
* Text Domain: team-members
* Domain Path: /languages
*/
// Define File Path
if (!\defined('PLUGIN_PATH'))
define('PLUGIN_PATH', dirname(__FILE__) . "/");
if (!\defined('PLUGIN_HTTP_PATH'))
define('PLUGIN_HTTP_PATH', plugin_dir_url(__FILE__));
// Import all classes
foreach (glob(PLUGIN_PATH . "classes/*.php") as $filename) {
include($filename);
}
// Include Dependencies
include_dependencies();
// This filter hinders the rendering process of line breaks
add_filter('tiny_mce_before_init', function ($options) {
$options['wpautop'] = false;
return $options;
});
remove_filter('the_content', 'wpautop');
remove_filter('the_excerpt', 'wpautop');
// Initialize the Plugin
$team_member_manager = new TeamMemberManager();
$team_member_shortcode_manager = new ShortcodeManager();
$team_member_post_type_manager = new PostTypeManager();
function include_dependencies()
{
// Bootstrap CSS
wp_register_style(
'prefix_bootstrap',
'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css'
);
wp_enqueue_style('prefix_bootstrap');
// Bootstrap JS
wp_register_script(
'prefix_bootstrap',
'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js'
);
wp_enqueue_script('prefix_bootstrap');
// Own CSS
wp_register_style(
'team-member',
\PLUGIN_HTTP_PATH . 'public/css/team-member.css'
);
wp_enqueue_style('team-member');
}