-
Notifications
You must be signed in to change notification settings - Fork 0
/
modifying-the-lead-profile.php
76 lines (49 loc) · 1.55 KB
/
modifying-the-lead-profile.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
<?php
/**
* PHP Class example. Seeks to show users how to add tabs and tab content to the lead profile.
*/
if (!class_exists('Lead_Profile_Custom_Tabs')) {
class Lead_Profile_Custom_Tabs {
static $tab_id; /* static class variable */
/**
* Initialize class
*/
public function __construct() {
self::$tab_id = 'wpleads_new_tab';
self::load_hooks();
}
/**
* Loads hooks and filters
*/
private function load_hooks() {
/* add nav tabs */
add_filter('wpl_lead_tabs', array( __CLASS__ , 'create_nav_tabs' ) , 10, 1);
/* add nav tab content */
add_action( 'wpl_print_lead_tab_sections' , array( __CLASS__ , 'add_content_container' ) );
}
/**
* Create New Nav Tabs in WordPress Leads - Lead UI
*/
public static function create_nav_tabs( $nav_items ) {
global $post;
/* Add attachments tab */
$nav_items[] = array(
'id'=> self::$tab_id,
'label'=> __( 'New Tab' , 'inbound-pro' )
);
return $nav_items;
}
/**
* Prints container content
*/
public static function add_content_container() {
global $post;
?>
<div class="lead-profile-section" id="<? echo self::$tab_id; ?>" >
<!--tab contents here-->
</div>
<?php
}
}
new Lead_Profile_Custom_Tabs;
}