This file contains 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 | |
/** | |
* Practical example on how to use ajax php functions | |
**/ | |
$html = '<p>This is your HTML you want to apply geotargeting, if you have complex and large content you could use ob_start() and ob_get_clean() to fill this variable with the HTML</p>'; | |
$html_world = '<p>Some other HTML for everyone except US and CA</p>'; | |
// We echo the part for and US,CA. Javascript will take care of hide or show the $html | |
echo ajax_geotwp_filter( ['country' => 'US,CA'],$html); |
This file contains 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 Remote Test | |
* Plugin URI: | |
* Version: 0.1 | |
* Description: Debug wp_remote_get and wp_remote_post | |
* Author: Damian Logghe | |
* Author URI: http://wp.timersys.com | |
*/ |
This file contains 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 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 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
#EDD + Nginx - protect your files | |
location ~ ^/wp-content/uploads/edd/(.*?)\.zip$ { | |
rewrite / permanent; | |
} |
This file contains 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
jQuery( document ).ready(function(){ | |
FB.Event.subscribe( 'edge.create', function( href ) { | |
createCookie('wptuts-lock_'+wptuts_content_locker.ID,true,9999); | |
location.reload(); //if you use cache maybe you want to add a ?nocache=true to this url | |
}); | |
}); | |
function createCookie( name, value, days ) { |
This file contains 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 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 include this line | |
/** | |
* Enable support for WooCommerce Price Based on Country and GeotargetingWP | |
* First enable cache mode or you will consume lot of credits. | |
*/ | |
if( function_exists('geot_country_code')) { | |
add_action( 'init', 'geotwp_wcpb_set_country', 10 ); | |
function geotwp_wcpb_set_country(){ | |
if( ! function_exists('wcpbc_set_woocommerce_country') ) |
This file contains 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 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'); |