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