-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclass-gf-chip-bootstrap.php
More file actions
45 lines (37 loc) · 1.06 KB
/
class-gf-chip-bootstrap.php
File metadata and controls
45 lines (37 loc) · 1.06 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
<?php
/**
* Bootstrap class for CHIP for Gravity Forms.
*
* @package GravityFormsCHIP
*/
defined( 'ABSPATH' ) || exit;
/**
* Bootstrap class for CHIP for Gravity Forms.
*/
class GF_CHIP_Bootstrap {
/**
* Loads the addon and registers it with Gravity Forms.
*/
public static function load_addon() {
require_once GF_CHIP_PLUGIN_PATH . 'class-gf-chip-api.php';
require_once GF_CHIP_PLUGIN_PATH . '/class-gf-chip.php';
GFAddOn::register( 'GF_Chip' );
add_filter( 'plugin_action_links_' . plugin_basename( GF_CHIP_PLUGIN_FILE ), array( 'GF_CHIP_Bootstrap', 'gf_chip_setting_link' ) );
}
/**
* Adds the Settings link to the plugin action links.
*
* @param array $links Plugin action links.
* @return array Modified links.
*/
public static function gf_chip_setting_link( $links ) {
$new_links = array(
'settings' => sprintf(
'<a href="%1$s">%2$s</a>',
admin_url( 'admin.php?page=gf_settings&subview=gravityformschip' ),
esc_html__( 'Settings', 'chip-for-gravity-forms' )
),
);
return array_merge( $new_links, $links );
}
}