Manually check if an Ad can be displayed on a page.
-
Hi there, I’m trying to create a custom function to hide placeholder ads (ads with a wrapper class of ad-placeholder) if a user bought an Ad through our dedicated buy ads form.
I’m able to hide the placeholder ads by using
advanced-ads-can-displayfilter hook. I’m checking if the current ad have the placeholder class and check all the ads within a group where the current ad belong. And if any of the ads within the group does not have the placeholder class, the function will return false to hide the current placeholder ad.The only problem here is that, I should not be checking against all ads within the group. I should only check the ads that are showing on the same page as the placeholder ad.
Is there a way to know if an Ad can be displayed on the current page?
I’ve tried using
Advanced_Ads_Display_Conditionsclass methods. But after checking the plugin source code, I found out that these methods uses apostinfo from the ads’optionsproperty. After checking, ads does not have thepostdata on the time the hook is called.What am I doing wrong here?
Is there any other way to achieve what I’m trying to do?Any help would be greatly appreciated. Thank you!
The topic ‘Manually check if an Ad can be displayed on a page.’ is closed to new replies.