Skip to content

Instantly share code, notes, and snippets.

@jwenerd
Created July 21, 2014 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwenerd/169d9e2a06ed9fcb17b2 to your computer and use it in GitHub Desktop.
Save jwenerd/169d9e2a06ed9fcb17b2 to your computer and use it in GitHub Desktop.
<?php
/*
* The site wide tags tag that we use on the explore blog
* will save revisions into the explore blog - we don't want that since
* it useless data replication
*/
add_filter('sitewide_tags_allowed_post_types',function ($post_types){
$post_types['revision'] = false;
// var_dump($post_types);
return $post_types;
}, 100);
if( is_admin() ){
add_action('admin_init','psu_sitewide_tags_prevent_revision');
}
function psu_sitewide_tags_prevent_revision(){
if(function_exists('get_sitewide_tags_option')){
add_filter('wp_revisions_to_keep','psu_sitewide_tags_no_revisions_on_tags_blog',100);
function psu_sitewide_tags_no_revisions_on_tags_blog($num){
global $blog_id;
if($blog_id == get_sitewide_tags_option('tags_blog_id')){
$num = 0;
// no revisions on the tags blog!
}
return $num;
} // end function
} //end function exists
} // end function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment