-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
38 lines (29 loc) · 1.15 KB
/
functions.php
File metadata and controls
38 lines (29 loc) · 1.15 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
<?php
function emailmanager_json_encode($to, $subject, $body) {
$emailmanager_email = array();
$emailmanager_email["From"] = get_option( 'pm_wp_mail_address' );
$emailmanager_email["To"] = $to;
$emailmanager_email["Subject"] = $subject;
if( get_option( 'pm_wp_mail_type' )==1 ) {
$emailmanager_email["HtmlBody"] = $body;
$emailmanager_email["TextBody"] = strip_tags($body);
} else {
$emailmanager_email["TextBody"] = strip_tags($body);
}
return json_encode($emailmanager_email);
}
function emailmanager_return_log($httpCode,$return) {
global $wpdb;
$table_name = $wpdb->prefix . "pm_wp_mail_log";
$wpdb->insert( $table_name, array( 'httpcode' => $httpCode, 'message' => $return ) );
}
function PluginUrl() {
//Try to use WP API if possible, introduced in WP 2.6
if (function_exists('plugins_url')) return trailingslashit(plugins_url(basename(dirname(__FILE__))));
//Try to find manually... can't work if wp-content was renamed or is redirected
$path = dirname(__FILE__);
$path = str_replace("\\","/",$path);
$path = trailingslashit(get_bloginfo('wpurl')) . trailingslashit(substr($path,strpos($path,"wp-content/")));
return $path;
}
?>