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
public function __construct () { | |
// other code... | |
add_action( 'user_profile_update_errors', array( $this, 'remove_empty_email_error' )); | |
} | |
function remove_empty_email_error( $arg ) { | |
if ( !empty( $arg->errors['empty_email'] ) ) unset( $arg->errors['empty_email'] ); | |
} |
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
/* LOG FUNCTION */ | |
function log( $input ){ | |
$time = date('d-m-Y H:i T'); | |
$file = get_template_directory() . '/log.txt'; | |
$handle = fopen($file, 'a'); | |
$data = '--------------- ' . $time."--------------- \r\n".$input."\r\n"; | |
fwrite($handle, $data); | |
fclose($handle); | |
} |
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
<!-- the id must match the id defined in the slot --> | |
<!-- style attribut is optional, but useful to prevent to shift layout after ad is loaded --> | |
<div id="banner1" style="width:300px; height:250px;"> | |
<script type="text/javascript"> | |
// id 'banner1' is used here, again | |
googletag.cmd.push(function() { googletag.display('banner1'); }); | |
</script> | |
</div> |
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
function adblock_alert(){ | |
?><script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
setTimeout(function(){ | |
if ( ba_blocked == true ) alert("You are using adblock."); | |
},200) | |
}); | |
</script><?php | |
} | |
add_action('wp_footer', 'adblock_alert'); |
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
/** this code allows to reserve ad space with a ratio, e.g., when width is 100% and height needs to be adjusted dynamically | |
https://www.w3schools.com/howto/howto_css_aspect_ratio.asp | |
"top-banner-ads" is the class of the main container, in Advanced Ads derived from the placement name | |
**/ | |
.top-banner-ads { | |
width: 100%; | |
height: auto; | |
padding-top: 12.4%; /* 728:90 ratio */ | |
position: relative; | |
} |
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 | |
/** | |
* Advanced Ads – Company Category | |
* | |
* @wordpress-plugin | |
* Plugin Name: Advanced Ads – Company Category | |
* Plugin URI: https://wpadvancedads.com | |
* Description: Add a Company category to ads so that you can group them. | |
* Version: 0.1 | |
* Author: Thomas Maier |
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
<div style="min-width: 300px; height: auto; padding: 10px; background: #fff; color: #333; text-align: center; border: solid 1px #ddd;"> | |
<p>Your location:</p> | |
<?php | |
if( class_exists( 'Advanced_Ads_Geo_Api' ) ) : | |
$api = Advanced_Ads_Geo_Api::get_instance(); | |
$ip = $api->get_real_IP_address(); | |
$error = false; | |
$my_country = ''; | |
$my_country_isoCode = ''; | |
$my_continent_code = ''; |
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 | |
/** | |
* Check if a specific customer has a valid, specific All Access Pass. | |
* | |
* @since 1.0.0 | |
* @param int - The ID of the user | |
* @param mixed - The ID of the All Access product, separate multiple IDs using comma | |
* @param mixed - The price_id (price variation) of the All Access product, separate multiple IDs using comma, leave empty for all price IDs | |
* @param string - The status of the pass we want to check if the user has. | |
* @return object/int - The All Access Pass if it exists or false if not. |
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 | |
/** | |
* Shortcode which can be used to easily give a user the option to log in or purchase an All Access Pass. | |
* If the user is already logged in but does not have a valid All Access Pass, they will see a buy button. | |
* If the user is both logged in and has a valid All Access Pass, they will be redirected to the page defined by the shortcode args. | |
* Can also be used to restrict content. | |
* | |
* @since 1.0.0 | |
* @param array $atts Shortcode attributes | |
* @param string $content |
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
/** | |
* Fix the "Current post is not identical to main post." | |
* and "Current query is not identical to main query." warnings in Advanced Ads | |
* caused by custom queries not using wp_reset_postdata() or wp_reset_query() | |
* | |
* @source https://wpadvancedads.com/manual/ad-debug-mode/ | |
* @source https://developer.wordpress.org/reference/classes/wp_query/ | |
* @source https://developer.wordpress.org/reference/functions/query_posts/ | |
* | |
* Developers should not use this and rather add wp_reset_postdata() or wp_reset_query() to their code |
OlderNewer