-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.php
More file actions
70 lines (60 loc) · 1.95 KB
/
plugin.php
File metadata and controls
70 lines (60 loc) · 1.95 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
* Plugin Name: Jason Chafin Core Functionality
* Plugin URI: https://github.com/Herm71/jc-core-functionality.git
* GitHub Plugin URI: https://github.com/Herm71/jc-core-functionality
* Description: Contains custom functionality. Theme independent.
* Version: 1.0.1
* Author: Jason Chafin
* Author URI: https://github.com/Herm71
* License: GPL2
* Requires Plugins: advanced-custom-fields-pro
*/
// Plugin Directory
define('JC_DIR', dirname(__FILE__));
/**
* Add link to Settings page from Plugins
*/
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'jc_custom_functionality_plugin_action_links' );
function jc_custom_functionality_plugin_action_links( $links ) {
// Build and escape the URL.
$url = esc_url( add_query_arg(
'page',
'jc-custom-functionality-settings',
get_admin_url() . 'options-general.php'
) );
// Create the link.
$settings_link = "<a href='$url'>" . __( 'Settings' ) . '</a>';
// Adds the link to the end of the array.
array_push(
$links,
$settings_link
);
return $links;
}
// Include Customization files.
// Plugin Settings.
if (file_exists(JC_DIR . '/lib/functions/settings.php') ) {
include_once JC_DIR . '/lib/functions/settings.php';
}
// Google Tag Manager.
if (file_exists(JC_DIR . '/lib/functions/gtm.php') ) {
include_once JC_DIR . '/lib/functions/gtm.php';
}
// Shortcodes.
if ( file_exists( JC_DIR . '/lib/functions/shortcodes.php' ) ) {
include_once JC_DIR . '/lib/functions/shortcodes.php';
}
// Disable XMLRP.
if (file_exists(JC_DIR . '/lib/functions/disable-xmlrpc.php') ) {
include_once JC_DIR . '/lib/functions/disable-xmlrpc.php';
}
// Security Headers.
require_once JC_DIR . '/lib/functions/security-headers.php';
if (file_exists(JC_DIR . '/lib/functions/security-headers.php') ) {
include_once JC_DIR . '/lib/functions/security-headers.php';
}
// General.
if (file_exists(JC_DIR . '/lib/functions/general.php') ) {
include_once JC_DIR . '/lib/functions/general.php';
}