Enable Share Counting for all networks

Per default MashShare is only counting Shares for Twitter and Facebook! If you are installing custom networks to your theme you want to make sure that MashShare is counting all shares. You can do that with a small helper class which loads an empty class named MashshareNetworks.
// Load only when MashShare is loaded and network add-on is NOT loaded
if ( prefix_can_use_plugin( 'mashsharer/mashshare.php' ) && ! prefix_can_use_plugin( 'mashshare-networks/mashshare-networks.php' ) ) {
 add_action( 'plugins_loaded', 'prefix_mashshare_add_networks_class' );

* Helper class for MashShare to make sure that all shares gets collected
function prefix_mashshare_add_networks_class() {
 if ( ! class_exists( 'MashshareNetworks' ) ) {
 * Class MashshareNetworks
 class MashshareNetworks {
 // This class is required to enable custom networks counting.
 // It won't be used if "MashshareNetworks" add-on is installed.

Still need help? Contact Us Contact Us