Advanced: Filters

We have built some custom filters into AdSanity to help developers like yourself extend and/or modify the default behaviors. Below is a list of filters that we include in the plugin. Custom code can be placed in your theme's functions.php file or in a custom plugin.

# adsanity_ads_posts_columns

Modifies the columns listed in the post listing on the admin.

https://gist.github.com/brandondove/19e7cabd26bfaff63b29f810fb7f2925

# adsanity_ads_sortable_posts_columns

Modifies the list of sortable columns in the post listing on the admin.

https://gist.github.com/brandondove/a02c15897cb6fff31dc661da7560068d

# adsanity_ads_posts_columns_{$column}_value

Allows you to set the value that should be displayed in a particular column. The column is identified by a key: {$column}

https://gist.github.com/brandondove/abe7418a645720bf2225dad9ee63b0b8

# adsanity_ad_sizes

This filter allows you to change the ad sizes that are available to choose when creating an ad unit.

https://gist.github.com/brandondove/c906fc398ae5dc7479c1035a6dbf788c

# adsanity_ads_posts_sortable_by_{$orderby}

Allows you to set custom sorting parameters

https://gist.github.com/brandondove/d560fa7012a535b4f845cb85880a1fb8

# pj_ads_labels

Allows you to change the labels of the ads custom post type.

https://gist.github.com/brandondove/26eea2b3dbe4de33aa4b8fa4bfb281de

# ads_setup

Allows you to modify any of the arguments passed to the register_post_type function

https://gist.github.com/brandondove/537464049cd25626fe636bea44ed3d17

# adsanity_post_class

Allows you to modify the css classes that wrap an ad unit

https://gist.github.com/brandondove/470fb3a01fa9b74362f8dc78296d904c

Didn't find what you were looking for?

If you're a subscriber to AdSanity and don't find an answer to your specific question please submit a request and our support department will address your issue quickly.