-
-
Save billerickson/8d5ef0b31aa4364a749a04f2a2834f24 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Shared Counts - Change "Total" to "Shares" | |
* @author Bill Erickson | |
* @see https://www.billerickson.net/code/shared-counts-change-label-for-total-field | |
*/ | |
function ea_shared_counts_change_total_label( $link ) { | |
$classes = explode( ' ', $link[ 'class' ] ); | |
if( 'included_total' == $link[ 'type' ] && in_array( 'style-icon', $classes ) ) { | |
$link[ 'label' ] = _n( 'Share', 'Shares', $link[ 'count' ] ); | |
} | |
return $link; | |
} | |
add_filter( 'shared_counts_link', 'ea_shared_counts_change_total_label' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment