-
Notifications
You must be signed in to change notification settings - Fork 0
/
marketing.php
65 lines (56 loc) · 1.77 KB
/
marketing.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
<?php
/*
* Add here marketing messages
*
* Hooks used
*/
add_action('wpcf_admin_page_init', 'wpcf_marketing_init');
/**
* Enqueue styles and scripts
*/
function wpcf_marketing_init() {
wp_enqueue_style('wpcf-marketing-congrats',
WPCF_RELPATH . '/marketing/congrats-post-types/style.css', array(),
WPCF_VERSION);
wp_enqueue_script('wpcf-marketing-congrats',
WPCF_RELPATH . '/marketing/congrats-post-types/js/jquery.wpcfnotif.js',
array('jquery'), WPCF_VERSION);
}
add_filter('types_message_custom_post_type_saved',
'types_marketing_message_custom_post_type_saved', 10, 3);
add_filter('types_message_custom_taxonomy_saved',
'types_marketing_message_custom_taxonomy_saved', 10, 3);
add_filter('types_message_custom_fields_saved',
'types_marketing_message_custom_fields_saved', 10, 3);
/*
*
*
*
* Hooks per page
*/
function types_marketing_message_custom_post_type_saved($message, $data, $update) {
$title = $data['labels']['name'];
$type = 'post_type';
ob_start();
include WPCF_ABSPATH . '/marketing/congrats-post-types/index.php';
$message = ob_get_contents();
ob_end_clean();
return $message;
}
function types_marketing_message_custom_taxonomy_saved($message, $data, $update) {
$title = $data['labels']['singular_name'];
$type = 'taxonomy';
ob_start();
include WPCF_ABSPATH . '/marketing/congrats-post-types/index.php';
$message = ob_get_contents();
ob_end_clean();
return $message;
}
function types_marketing_message_custom_fields_saved($message, $title, $update) {
$type = 'fields';
ob_start();
include WPCF_ABSPATH . '/marketing/congrats-post-types/index.php';
$message = ob_get_contents();
ob_end_clean();
return $message;
}