# wp-ultimate-post-grid/1.7.1/helpers/ajax.php

WP Ultimate Post Grid, version 1.7.1. 23 lines.

- Page: https://pluginprobe.com/plugins/wp-ultimate-post-grid/1.7.1/code/helpers/ajax.php
- Raw: https://pluginprobe.com/plugins/wp-ultimate-post-grid/1.7.1/raw/helpers/ajax.php
- Modified: 2015-04-15T08:46:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-ultimate-post-grid/1.7.1/code/helpers/ajax.php#L10-L20`.

```php
<?php

class WPUPG_Ajax {

    public function __construct()
    {
    }

    public function url()
    {
        $scheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';
        $ajaxurl = admin_url( 'admin-ajax.php', $scheme );
        $ajaxurl .= '?wpupg_ajax=1';

        // WPML AJAX Localization Fix
        global $sitepress;
        if( isset( $sitepress) ) {
            $ajaxurl .= '&lang='.$sitepress->get_current_language();
        }

        return $ajaxurl;
    }
}
```
