Skip to content

Instantly share code, notes, and snippets.

@aaronjorbin
Created May 2, 2012 15:18
Show Gist options
  • Save aaronjorbin/2577395 to your computer and use it in GitHub Desktop.
Save aaronjorbin/2577395 to your computer and use it in GitHub Desktop.
AddThis Remove from BBPress Topics
<?php
/*
* +--------------------------------------------------------------------------+
* | Copyright (c) 2012 Add This, LLC |
* +--------------------------------------------------------------------------+
* | This program is free software; you can redistribute it and/or modify |
* | it under the terms of the GNU General Public License as published by |
* | the Free Software Foundation; either version 2 of the License, or |
* | (at your option) any later version. |
* | |
* | This program is distributed in the hope that it will be useful, |
* | but WITHOUT ANY WARRANTY; without even the implied warranty of |
* | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* | GNU General Public License for more details. |
* | |
* | You should have received a copy of the GNU General Public License |
* | along with this program; if not, write to the Free Software |
* | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
* +--------------------------------------------------------------------------+
*/
/**
* Plugin Name: AddThis Remove from BBPress Topics
* Plugin URI: http://www.addthis.com
* Description: Don't display the AddThis bookmark tool on BBPress Topics
* Version: 0.1
*
* Author: The AddThis Team
* Author URI: http://www.addthis.com/blog
*/
add_filter('addthis_post_exclude', 'at_cookbook_addthis_bbpress_topic_exclude');
function at_cookbook_addthis_bbpress_topic_exclude($display)
{
// remove AddThis from topic post types in bbpress
if ( 'topic' == get_post_type() )
$display = false;
return $display;
}
@laflier
Copy link

laflier commented Jun 10, 2014

Thanks for posting.

This removes AddThis from topic pages, but it still appears on forum pages. I was able to remove AddThis from forum pages as well by changing the conditional in line 36.

See: https://gist.github.com/laflier/14b7b0dbc35018b127d0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment