-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
95 lines (66 loc) · 2.23 KB
/
Copy pathfunctions.php
File metadata and controls
95 lines (66 loc) · 2.23 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
class lassoThemeFunctions {
function __construct(){
// Set some constants
define('LASSO_THEME_VERSION', '0.1');
define('LASSO_THEME_DIR', get_stylesheet_directory());
define('LASSO_THEME_URL', get_stylesheet_directory_uri());
add_action('after_setup_theme', array($this,'setup'));
add_action('init', array($this,'editor_styles'));
add_action( 'init', array($this,'track_demo') );
require_once(LASSO_THEME_DIR.'/inc/helpers.php');
require_once(LASSO_THEME_DIR.'/inc/options.php');
require_once(LASSO_THEME_DIR.'/inc/scripts.php');
}
function setup(){
// set theme width
if ( ! isset( $content_width ) ) {
$content_width = 700;
}
// Add RSS feed links to <head> for posts and comments.
add_theme_support( 'automatic-feed-links' );
// Enable support for Post Thumbnails, and declare two sizes.
add_theme_support( 'post-thumbnails' );
// Switch default core markup for search form, comment form, and comments
add_theme_support( 'html5', array(
'search-form', 'comment-form', 'comment-list',
) );
register_nav_menus(
array(
'primary' => 'Primary'
)
);
// Add extended style support for aesop
add_theme_support("aesop-component-styles", array("parallax", "image", "quote", "gallery", "content", "video", "audio", "collection", "chapter", "document", "character", "map", "timeline" ) );
}
public function editor_styles(){
add_editor_style( 'editor-style.css' );
}
function track_demo(){
add_action( 'ninja_forms_post_process', array($this,'track_demo_emails') );
}
function track_demo_emails(){
if ( class_exists('trackWP') ) {
global $ninja_forms_processing;
// generate a random userid
$user_id = rand();
// get data from the form
$data = $ninja_forms_processing->get_all_fields();
// get the email field
$email = $data[6];
// set some traits for this event and user
$traits = array(
'userId' => $user_id,
'email' => $email,
);
// set some props for this event
$props = array(
'email' => $email,
'created' => time()
);
trackWP::identify_user( $user_id, $traits );
trackWP::track_event( 'demo_created', $props, $traits, $user_id );
}
}
}
new lassoThemeFunctions;