This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if( function_exists( 'geot_target' ) ) { | |
if( geot_target( 'AR' ) ) { | |
echo 'Only show to Argentina'; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds GeoTarget Widget | |
* @since 1.0.0 | |
*/ | |
class GeotS_Widget extends WP_Widget { | |
/** | |
* Register widget with WordPress. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Wp Rocket + GeotargetingWP States | |
* Plugin URI: https://geotargetingwp.com | |
* Description: Enable states cache for WPRocket. | |
* Author: timersys | |
* Author URI: https://geotargetingwp.com | |
*/ | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WP Popups newsletter lists | |
* Plugin URI: https://wppopups.com | |
* Description: Beginner friendly WordPress popup builder plugin. | |
* Author: timersys | |
* Author URI: https://wppopups.com | |
* Version: 1.0.0 | |
*/ | |
add_filter( 'wppopups/newsletter/subscribe_data', function($data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Disable GeotargetingWP Sessions | |
* Plugin Author: Damian Logghe | |
*/ | |
// disable geotwp sessions | |
add_filter( 'geot/sessions/start_session', '__return_false'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* geot_target() | |
* | |
* Main function that return true or false depending if current user | |
* target the given countries | |
* | |
* @param string/Array $country - Pass an array of countries ,country name or country code | |
* @param string $country_region - Region name | |
* @param string $exclude/Array -Pass an array of countries ,country name or country code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// insert javascript into WordPress posts or popups | |
// use shortcode [wpp_insert] | |
add_shortcode( 'wpp_insert', 'wpp_insert_code' ); | |
function wpp_insert_code() { | |
ob_start(); | |
?> | |
<!-- paste your html and javascript here --> | |
<?php | |
$html = ob_get_clean(); | |
return $html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// cancel geotargeted posts on certain pages | |
add_filter('geot/cancel_posts_where', 'geotwp_cancel_geo' ); | |
function geotwp_cancel_geo( $query ) { | |
// cancel for every page that is not search | |
if( ! is_page('search') ) { | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don' add this tag | |
// Open popup after WpForms submission | |
add_action( 'wpforms_process_complete_534', 'spu_popup_trigger' ); | |
function spu_popup_trigger(){ | |
add_action('wp_footer','spu_open_popup',99); | |
} | |
function spu_open_popup(){ | |
echo '<script>setTimeout(function(){SPU.show(529)},1000);</script>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // don't add this tag | |
// Print javascript code in the footer of the site to trigger the popup upon form submission | |
add_action('wp_footer', 'add_popups_trigger_code',150 ); | |
function add_popups_trigger_code(){ | |
// show code on certain page, comment out to print code on every page | |
if( ! is_page(520) ) | |
return; | |
?> | |
<script> |