forked from jordesign/wp-church-center
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-church-center.php
executable file
·85 lines (63 loc) · 2.34 KB
/
wp-church-center.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
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link http://wpchurch.team
* @since 1.0.0
* @package WP_Church_Center
*
* @wordpress-plugin
* Plugin Name: WP Church Center
* Plugin URI: http://wpchurch.center
* Description: Provides a 'Next Steps' Center for your Church.
* Version: 1.2.2
* Author: Jordesign, WP Church Team
* Author URI: http://wpchurch.team/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: WP_Church_Center
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
/** Custom Post Type */
require_once plugin_dir_path( __FILE__ ) . 'cpt.php';
/** Customizer Panels */
require_once plugin_dir_path( __FILE__ ) . 'customizer.php';
/** PageTemplater Class to add Page Template */
require_once plugin_dir_path( __FILE__ ) . 'templates/pagetemplater.php';
/** Archive Page Templates */
require_once plugin_dir_path( __FILE__ ) . 'templates.php';
/** Page Ordering */
require_once plugin_dir_path( __FILE__ ) . 'page-ordering/simple-page-ordering.php';
add_action( 'after_setup_theme', 'wpcc_acf_setup' );
function wpcc_acf_setup() {
/** Check if ACF is used with another plugin, if not already called, use this one */
if( ! class_exists('acf') ) {
// 1. customize ACF path
add_filter('acf/settings/path', 'wpcc_acf_settings_path');
function wpcc_acf_settings_path( $path ) {
// update path
$path = plugin_dir_path( __FILE__ ) . '/advanced-custom-fields/';
// return
return $path;
}
// 2. customize ACF dir
add_filter('acf/settings/dir', 'wpcc_acf_settings_dir');
function wpcc_acf_settings_dir( $dir ) {
// update path
$dir = plugin_dir_path( __FILE__ ) . '/advanced-custom-fields/';
// return
return $dir;
}
// 3. Hide ACF field group menu item
add_filter('acf/settings/show_admin', '__return_false');
require_once plugin_dir_path( __FILE__ ) . 'advanced-custom-fields/acf.php';
}
}