[] ] ); $old_args = $args['html_atts']; $args['html_atts'] = [ 'class' => 'share-box', ]; $args['html_atts'] = wp_parse_args( $old_args, $args['html_atts'] ); $social_urls = [ 'facebook' => str_replace( '{url}', $home_url, 'https://www.facebook.com/sharer/sharer.php?u={url}' ), 'twitter' => str_replace( '{url}', $home_url, 'https://twitter.com/share?url={url}' ), 'google_plus' => str_replace( '{url}', $home_url, 'https://plus.google.com/share?url={url}' ), 'pinterest' => str_replace( '{url}', $home_url, '#' ), 'linkedin' => str_replace( '{url}', $home_url, 'https://www.linkedin.com/shareArticle?url={url}' ), 'reddit' => str_replace( '{url}', $home_url, 'http://www.reddit.com/submit?url={url}' ), 'vk' => str_replace( '{url}', $home_url, 'http://vk.com/share.php?url={url}' ), 'ok' => str_replace( '{url}', $home_url, 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl={url}' ), ]; $all_links = []; $share_box_networks = [ [ 'for' => 'facebook', 'enabled' => get_theme_mod( 'share_facebook', 'yes' ) === 'yes' || $check_for_preview, 'name' => __( 'Facebook', 'blocksy' ), 'icon' => ' ', ], [ 'for' => 'twitter', 'enabled' => get_theme_mod( 'share_twitter', 'yes' ) === 'yes' || $check_for_preview, 'name' => __( 'Twitter', 'blocksy' ), 'icon' => ' ', ], [ 'enabled' => get_theme_mod( 'share_pinterest', 'yes' ) === 'yes' || $check_for_preview, 'for' => 'pinterest', 'name' => __( 'Pinterest', 'blocksy' ), 'icon' => ' ', ], [ 'enabled' => get_theme_mod( 'share_gplus', 'yes' ) === 'yes' || $check_for_preview, 'for' => 'google_plus', 'name' => __( 'Google Plus', 'blocksy' ), 'icon' => ' ', ], [ 'enabled' => get_theme_mod( 'share_linkedin', 'yes' ) === 'yes' || $check_for_preview, 'for' => 'linkedin', 'name' => __( 'LinkedIn', 'blocksy' ), 'icon' => ' ', ], [ 'enabled' => false, 'for' => 'reddit', 'name' => __( 'Reddit', 'blocksy' ), 'icon' => ' ', ], [ 'enabled' => false, 'for' => 'vk', 'name' => __( 'VK', 'blocksy' ), 'icon' => ' ', ], [ 'enabled' => false, 'for' => 'ok', 'name' => __( 'Odnoklassniki', 'blocksy' ), 'icon' => ' ', ], ]; if ( ! is_array( $share_box_networks ) ) { return ''; } if ( count( $share_box_networks ) === 0 ) { return ''; } $has_enabled_network = 0; foreach ( $share_box_networks as $share_network ) { if ( $share_network['enabled'] ) { $has_enabled_network++; } } if ( ! $has_enabled_network ) { return ''; } ob_start(); ?>
>
'!', '%2A' => '*', '%27' => "'", '%28' => '(', '%29' => ')', ]; return strtr( rawurlencode( $str ), $revert ); }