Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created January 22, 2018 22:11
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/8d5ef0b31aa4364a749a04f2a2834f24 to your computer and use it in GitHub Desktop.
Save billerickson/8d5ef0b31aa4364a749a04f2a2834f24 to your computer and use it in GitHub Desktop.
<?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