Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created Feb 26, 2016
Embed
What would you like to do?
<?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