| 1 |
<?php |
| 2 |
|
| 3 |
class WPUPG_Ajax { |
| 4 |
|
| 5 |
public function __construct() |
| 6 |
{ |
| 7 |
} |
| 8 |
|
| 9 |
public function url() |
| 10 |
{ |
| 11 |
$scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http'; |
| 12 |
$ajaxurl = admin_url( 'admin-ajax.php', $scheme ); |
| 13 |
$ajaxurl .= '?wpupg_ajax=1'; |
| 14 |
|
| 15 |
// WPML AJAX Localization Fix |
| 16 |
global $sitepress; |
| 17 |
if( isset( $sitepress) ) { |
| 18 |
$ajaxurl .= '&lang='.$sitepress->get_current_language(); |
| 19 |
} |
| 20 |
|
| 21 |
return $ajaxurl; |
| 22 |
} |
| 23 |
} |