function arrNetworks($name, $url, $title) { global $mashsb_options, $post; $singular = isset($mashsb_options['singular']) ? $singular = true : ($singular = false); if (function_exists('mashsuGetShortURL')) { mashsuGetShortURL() !== 0 ? $urltw = mashsuGetShortURL() : ($urltw = $url); } else { $urltw = $url; } function_exists('MASHOG') ? $image = MASHOG()->MASHOG_OG_Output->_add_image() : ($image = mashsb_get_image($post->ID)); function_exists('MASHOG') ? $desc = MASHOG()->MASHOG_OG_Output->_get_description() : ($desc = urlencode(mashsb_get_excerpt_by_id($post->ID))); if (function_exists('MASHOG')) { $twittertitle = MASHOG()->MASHOG_OG_Output->_get_tw_title(); $twittertitle = html_entity_decode($twittertitle, ENT_QUOTES, 'UTF-8'); $twittertitle = urlencode($twittertitle); $twittertitle = str_replace('#', '%23', $twittertitle); $twittertitle = esc_html($twittertitle); empty($twittertitle) ? $twittertitle = $title : $twittertitle; } else { $twittertitle = $title; } !empty($mashsb_options['mashsharer_hashtag']) ? $via = '&via=' . $mashsb_options['mashsharer_hashtag'] : ($via = ''); $networks = apply_filters('mashsb_array_networks', array('facebook' => 'http://www.facebook.com/sharer.php?u=' . $url, 'twitter' => 'https://twitter.com/intent/tweet?text=' . $twittertitle . $via . '&url=' . $urltw, 'subscribe' => '#', 'url' => $url, 'title' => $title)); return isset($networks[$name]) ? $networks[$name] : ''; }
function mashsb_get_twitter_url() { global $wp, $post, $numpages; if (function_exists('mashsuGetShortURL')) { $url = mashsb_get_url(); mashsuGetShortURL($url) !== 0 ? $url = mashsuGetShortURL($url) : ($url = mashsb_get_url()); } else { $url = mashsb_get_url(); } return apply_filters('mashsb_get_twitter_url', $url); }
function mashsb_get_twitter_url() { if (function_exists('mashsb_get_shorturl_singular')) { $url = mashsb_get_shorturl_singular(mashsb_get_url()); } else { if (function_exists('mashsuGetShortURL')) { // compatibility mode for MashShare earlier than 3.0 $get_url = mashsb_get_url(); $url = mashsuGetShortURL($get_url); } else { $url = mashsb_get_url(); } } return apply_filters('mashsb_get_twitter_url', $url); }