Title: Using this plugin in PHP
Last modified: January 18, 2018

---

# Using this plugin in PHP

 *  Resolved [transbetty](https://wordpress.org/support/users/transbetty/)
 * (@transbetty)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/using-this-plugin-in-php/)
 * Hello, is there a way to directly use PHP functions/classes of this plugin in
   PHP? It would be great to have possibility to use plugin templates (not just 
   in the page/post content).
 * simplified:
 * `<?php if (customPluginFunction == "US") { .. do something .. "} ?>`

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Damian](https://wordpress.org/support/users/timersys/)
 * (@timersys)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/using-this-plugin-in-php/#post-9877392)
 * The free version only have these available:
 *     ```
       function geot_target( $country = '', $region = '', $exclude_country = '', $exclude_region  = '' ) {
        	global $geot;
   
        	return $geot->functions->target( $country, $region, $exclude_country, $exclude_region );
        }
   
       /**
        * Get current user country
        * @return array Current user country array
        */
        function geot_user_country( ){
        	global $geot;
   
        	return $geot->functions->get_user_country();
        }
   
       /** 
        * Displays the 2 character country for the current user
        * [geot_country_code] 
        * @return  string country CODE
        **/
       function geot_country_code( ) {
   
       	$c = geot_user_country();
   
       	return $c->isoCode;
       }
   
       /** 
        * Displays the country name for the current user
        * [geot_country_name]
        * @return  string country name
        **/
       function geot_country_name() {
       	global $geot;
   
       	$c = $geot->functions->get_user_country();
   
       	return $c->name;
       }
       ```
   
 * Thanks
 *  Thread Starter [transbetty](https://wordpress.org/support/users/transbetty/)
 * (@transbetty)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/using-this-plugin-in-php/#post-9877990)
 * I will test it. Thank you for the super fast answer!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Using this plugin in PHP’ is closed to new replies.

 * ![](https://ps.w.org/geotargeting/assets/icon-256x256.png?rev=1829366)
 * [GeoTargeting Lite - WordPress Geolocation](https://wordpress.org/plugins/geotargeting/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geotargeting/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geotargeting/)
 * [Active Topics](https://wordpress.org/support/plugin/geotargeting/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geotargeting/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geotargeting/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 2 participants
 * Last reply from: [transbetty](https://wordpress.org/support/users/transbetty/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/using-this-plugin-in-php/#post-9877990)
 * Status: resolved