Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created April 4, 2018 16:25
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 billerickson/4d74f188c09ff0402e3e822162815a50 to your computer and use it in GitHub Desktop.
Save billerickson/4d74f188c09ff0402e3e822162815a50 to your computer and use it in GitHub Desktop.
<?php
/**
* Remove Shared Counts from sponsored posts
*
* @see
* @author Bill Erickson
*/
function be_remove_shared_counts_from_sponsored_posts( $locations ) {
if( is_single() && has_category( 'sponsored' ) ) {
$locations['before']['hook'] = false;
$locations['before']['filter'] = false;
$locations['after']['hook'] = false;
$locations['after']['filter'] = false;
}
return $locations;
}
add_filter( 'shared_counts_theme_locations', 'be_remove_shared_counts_from_sponsored_posts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment