| 1 |
<?php |
| 2 |
/* Home for Backwards Compatibility Functions */ |
| 3 |
|
| 4 |
/* Form Display Functions */ |
| 5 |
if (!function_exists('mc_display_widget')){ |
| 6 |
function mc_display_widget($args=array()){ |
| 7 |
mailchimpSF_signup_form($args); |
| 8 |
} |
| 9 |
} |
| 10 |
if (!function_exists('mailchimpSF_display_widget')){ |
| 11 |
function mailchimpSF_display_widget($args=array()){ |
| 12 |
mailchimpSF_signup_form($args); |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
|
| 17 |
/* Shortcodes */ |
| 18 |
add_shortcode('mailchimpsf_widget', 'mailchimpSF_shortcode'); |
| 19 |
|
| 20 |
|
| 21 |
/* Functions for < WP 3.0 Compat */ |
| 22 |
|
| 23 |
if (!function_exists('home_url')) { |
| 24 |
/** |
| 25 |
* Retrieve the home url for the current site. |
| 26 |
* |
| 27 |
* Returns the 'home' option with the appropriate protocol, 'https' if |
| 28 |
* is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is |
| 29 |
* overridden. |
| 30 |
* |
| 31 |
* @package WordPress |
| 32 |
* @since 3.0.0 |
| 33 |
* |
| 34 |
* @uses get_home_url() |
| 35 |
* |
| 36 |
* @param string $path (optional) Path relative to the home url. |
| 37 |
* @param string $scheme (optional) Scheme to give the home url context. Currently 'http','https' |
| 38 |
* @return string Home url link with optional path appended. |
| 39 |
*/ |
| 40 |
function home_url( $path = '', $scheme = null ) { |
| 41 |
return get_home_url(null, $path, $scheme); |
| 42 |
} |
| 43 |
|
| 44 |
} |
| 45 |
|
| 46 |
if (!function_exists('get_home_url')) { |
| 47 |
/** |
| 48 |
* Retrieve the home url for a given site. |
| 49 |
* |
| 50 |
* Returns the 'home' option with the appropriate protocol, 'https' if |
| 51 |
* is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is |
| 52 |
* overridden. |
| 53 |
* |
| 54 |
* @package WordPress |
| 55 |
* @since 3.0.0 |
| 56 |
* |
| 57 |
* @param int $blog_id (optional) Blog ID. Defaults to current blog. |
| 58 |
* @param string $path (optional) Path relative to the home url. |
| 59 |
* @param string $scheme (optional) Scheme to give the home url context. Currently 'http','https' |
| 60 |
* @return string Home url link with optional path appended. |
| 61 |
*/ |
| 62 |
function get_home_url( $blog_id = null, $path = '', $scheme = null ) { |
| 63 |
$orig_scheme = $scheme; |
| 64 |
|
| 65 |
if ( !in_array( $scheme, array( 'http', 'https' ) ) ) |
| 66 |
$scheme = is_ssl() && !is_admin() ? 'https' : 'http'; |
| 67 |
|
| 68 |
if ( empty( $blog_id ) || !is_multisite() ) |
| 69 |
$home = get_option( 'home' ); |
| 70 |
else |
| 71 |
$home = get_blog_option( $blog_id, 'home' ); |
| 72 |
|
| 73 |
$url = str_replace( 'http://', "$scheme://", $home ); |
| 74 |
|
| 75 |
if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false ) |
| 76 |
$url .= '/' . ltrim( $path, '/' ); |
| 77 |
|
| 78 |
return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id ); |
| 79 |
} |
| 80 |
} |
| 81 |
|
| 82 |
if (!function_exists('is_multisite')) { |
| 83 |
/** |
| 84 |
* Whether Multisite support is enabled |
| 85 |
* |
| 86 |
* @since 3.0.0 |
| 87 |
* |
| 88 |
* @return bool True if multisite is enabled, false otherwise. |
| 89 |
*/ |
| 90 |
function is_multisite() { |
| 91 |
if ( defined( 'MULTISITE' ) ) |
| 92 |
return MULTISITE; |
| 93 |
|
| 94 |
if ( defined( 'VHOST' ) || defined( 'SUNRISE' ) ) |
| 95 |
return true; |
| 96 |
|
| 97 |
return false; |
| 98 |
} |
| 99 |
} |
| 100 |
?> |