Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created February 26, 2016 20:14
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/f50235c410feb0925a74 to your computer and use it in GitHub Desktop.
Save billerickson/f50235c410feb0925a74 to your computer and use it in GitHub Desktop.
<?php
/**
* Change button location based on share count
* @author Bill Erickson
* @link http://www.billerickson.net/code/easc-location-based-on-share-count
*
* @param array $locations
* @return array $locations
*/
function be_easc_location( $locations ) {
$total = ea_share()->core->count( false, 'included_total' );
if( 10 > $total ) {
$locations['before']['hook'] = false;
$locations['before']['filter'] = false;
}
return $locations;
}
add_filter( 'ea_share_count_theme_locations', 'be_easc_location' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment