PATH:
home
/
letacommog
/
lenazen
/
wp-content
/
themes
/
Avada
/
includes
<?php /** * Social Icons class. * * @author ThemeFusion * @copyright (c) Copyright by ThemeFusion * @link http://theme-fusion.com * @package Avada * @subpackage Core * @since 4.0.0 */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { die; } /** * Social sharing handler. * * @since 4.0.0 */ class Avada_Social_Sharing extends Avada_Social_Icon { /** * Renders all social icons not belonging to shortcodes. * * @since 3.5.0 * @access public * @param array $args Holding all necessarry data for social icons. * @return string The HTML mark up for social icons, incl. wrapping container. */ public function render_social_icons( $args ) { parent::$args = $args; // Get a list of all the available social networks. $social_networks_full_array = Fusion_Data::fusion_social_icons( true, true ); if ( isset( parent::$args['authorpage'] ) && 'yes' === parent::$args['authorpage'] ) { $social_networks = $this->get_authorpage_social_links_array( parent::$args ); } else { $social_networks = $this->get_sharingbox_social_links_array( parent::$args ); } $html = ''; $icons = ''; $i = 0; if ( isset( parent::$args['authorpage'] ) && 'yes' === parent::$args['authorpage'] && isset( parent::$args['color_type'] ) ) { $per_icon_colors = ( 'brand' === parent::$args['color_type'] ) ? true : false; } else { $per_icon_colors = ( 'brand' === Avada()->settings->get( 'sharing_social_links_color_type' ) ) ? true : false; } $number_of_social_networks = count( $social_networks ); foreach ( $social_networks as $network => $icon_args ) { $icon_options = array( 'social_network' => $network, 'social_link' => $icon_args['url'], ); if ( $per_icon_colors ) { $network_for_colors = str_replace( 'sharing_', '', $network ); $network_for_colors = ( in_array( $network_for_colors, array( 'google', 'googleplus' ), true ) ) ? 'gplus' : $network_for_colors; if ( parent::$args['icon_boxed'] ) { $icon_options['icon_color'] = '#ffffff'; $icon_options['box_color'] = $social_networks_full_array[ $network_for_colors ]['color']; } else { $icon_options['icon_color'] = $social_networks_full_array[ $network_for_colors ]['color']; $icon_options['box_color'] = '#ffffff'; } } else { $icon_options['icon_color'] = Avada()->settings->get( 'sharing_social_links_icon_color' ); $icon_options['box_color'] = Avada()->settings->get( 'sharing_social_links_box_color' ); } // Check if are on the last social icon; // $i needs to be incremented first to make it match the count() value. $i++; $icon_options['last'] = ( $i == $number_of_social_networks ) ? true : false; $icons .= parent::get_markup( $icon_options ); } if ( ! empty( $icons ) ) { $attr = array( 'class' => 'fusion-social-networks', ); if ( parent::$args['icon_boxed'] ) { $attr['class'] .= ' boxed-icons'; } $html = '<div ' . fusion_attr( 'social-icons-class-social-networks', $attr ) . '><div ' . fusion_attr( 'fusion-social-networks-wrapper' ) . '>' . $icons; if ( isset( parent::$args['position'] ) && ( 'header' === parent::$args['position'] || 'footer' === parent::$args['position'] ) ) { $html .= '</div></div>'; } else { $html .= '<div class="fusion-clearfix"></div></div></div>'; } } return apply_filters( 'avada_social_sharing_html', $html, $args ); } /** * Set up the array for sharing box social networks. * * @access public * @since 3.5.0 * @param array $args Holding all necessarry data for social icons. * @return array The social links array containing the social media and links to them. */ public function get_sharingbox_social_links_array( $args ) { $social_links_array = array(); if ( Avada()->settings->get( 'sharing_facebook' ) ) { if ( ! avada_jetpack_is_mobile() ) { $facebook_url = 'https://www.facebook.com/sharer.php?u=' . rawurlencode( $args['link'] ) . '&t=' . rawurlencode( $args['title'] ); } else { $facebook_url = 'https://m.facebook.com/sharer.php?u=' . $args['link'] . '&t=' . rawurlencode( $args['title'] ); } $social_links_array['facebook'] = array( 'url' => $facebook_url, ); } if ( Avada()->settings->get( 'sharing_twitter' ) ) { $social_links_array['twitter'] = array( 'url' => 'https://twitter.com/share?text=' . rawurlencode( html_entity_decode( $args['title'], ENT_COMPAT, 'UTF-8' ) ) . '&url=' . rawurlencode( $args['link'] ), ); } if ( Avada()->settings->get( 'sharing_linkedin' ) ) { $social_links_array['linkedin'] = array( 'url' => 'https://www.linkedin.com/shareArticle?mini=true&url=' . $args['link'] . '&title=' . rawurlencode( $args['title'] ) . '&summary=' . rawurlencode( mb_substr( html_entity_decode( $args['description'], ENT_QUOTES, 'UTF-8' ), 0, 256 ) ), ); } if ( Avada()->settings->get( 'sharing_reddit' ) ) { $social_links_array['reddit'] = array( 'url' => 'http://reddit.com/submit?url=' . $args['link'] . '&title=' . rawurlencode( $args['title'] ), ); } if ( Avada()->settings->get( 'sharing_whatsapp' ) ) { $social_links_array['whatsapp'] = array( 'url' => 'https://api.whatsapp.com/send?text=' . rawurlencode( $args['link'] ), ); } if ( Avada()->settings->get( 'sharing_google' ) ) { $social_links_array['googleplus'] = array( 'url' => 'https://plus.google.com/share?url=' . $args['link'], ); } if ( Avada()->settings->get( 'sharing_tumblr' ) ) { $social_links_array['tumblr'] = array( 'url' => 'http://www.tumblr.com/share/link?url=' . rawurlencode( $args['link'] ) . '&name=' . rawurlencode( $args['title'] ) . '&description=' . rawurlencode( $args['description'] ), ); } if ( Avada()->settings->get( 'sharing_pinterest' ) ) { $social_links_array['pinterest'] = array( 'url' => 'http://pinterest.com/pin/create/button/?url=' . rawurlencode( $args['link'] ) . '&description=' . rawurlencode( $args['description'] ) . '&media=' . rawurlencode( $args['pinterest_image'] ), ); } if ( Avada()->settings->get( 'sharing_vk' ) ) { $social_links_array['vk'] = array( 'url' => 'http://vkontakte.ru/share.php?url=' . rawurlencode( $args['link'] ) . '&title=' . rawurlencode( $args['title'] ) . '&description=' . rawurlencode( $args['description'] ), ); } if ( Avada()->settings->get( 'sharing_email' ) ) { $social_links_array['email'] = array( 'url' => 'mailto:?subject=' . rawurlencode( $args['title'] ) . '&body=' . $args['link'], ); } return $social_links_array; } /** * Set up the array for author page social networks. * * @since 3.5.0 * @access public * @param array $args Holding all necessarry data for social icons. * @return array The social links array containing the social media and links to them. */ public function get_authorpage_social_links_array( $args ) { $social_links_array = array(); if ( get_the_author_meta( 'author_facebook', $args['author_id'] ) ) { $social_links_array['facebook'] = array( 'url' => get_the_author_meta( 'author_facebook', $args['author_id'] ), ); } if ( get_the_author_meta( 'author_twitter', $args['author_id'] ) ) { $social_links_array['twitter'] = array( 'url' => get_the_author_meta( 'author_twitter', $args['author_id'] ), ); } if ( get_the_author_meta( 'author_linkedin', $args['author_id'] ) ) { $social_links_array['linkedin'] = array( 'url' => get_the_author_meta( 'author_linkedin', $args['author_id'] ), ); } if ( get_the_author_meta( 'author_dribble', $args['author_id'] ) ) { $social_links_array['dribbble'] = array( 'url' => get_the_author_meta( 'author_dribble', $args['author_id'] ), ); } if ( get_the_author_meta( 'author_whatsapp', $args['author_id'] ) ) { $social_links_array['whatsapp'] = array( 'url' => get_the_author_meta( 'author_whatsapp', $args['author_id'] ), ); } if ( get_the_author_meta( 'author_gplus', $args['author_id'] ) ) { $social_links_array['googleplus'] = array( 'url' => get_the_author_meta( 'author_gplus', $args['author_id'] ), ); } if ( get_the_author_meta( 'author_email', $args['author_id'] ) ) { $social_links_array['email'] = array( 'url' => get_the_author_meta( 'author_email', $args['author_id'] ), ); } return $social_links_array; } } /* Omit closing PHP tag to avoid "Headers already sent" issues. */
[+]
..
[-] class-fusion-builder-redux-options.php
[edit]
[-] class-avada-megamenu.php
[edit]
[-] wc-functions.php
[edit]
[-] class-avada-privacy-embeds.php
[edit]
[-] class-avada-template.php
[edit]
[+]
options
[-] class-avada-multiple-featured-images.php
[edit]
[-] class-avada-googlemap.php
[edit]
[-] fusion-functions.php
[edit]
[-] class-avada-nav-walker.php
[edit]
[-] fusion-shared-options.php
[edit]
[-] class-avada-migrate.php
[edit]
[+]
upgrade
[-] avada-functions.php
[edit]
[-] class-avada-breadcrumbs.php
[edit]
[-] class-avada-remote-installer.php
[edit]
[-] class-avada-contact.php
[edit]
[-] class-avada-sermon-manager.php
[edit]
[+]
importer
[-] class-avada-maintenance.php
[edit]
[-] class-avada-avadaredux.php
[edit]
[-] class-avada-admin.php
[edit]
[-] class-avada-blog.php
[edit]
[-] class-avada-nav-walker-megamenu.php
[edit]
[+]
metaboxes
[-] class-avada-head.php
[edit]
[+]
ls-skins
[-] class-avada-options-conditionals.php
[edit]
[-] class-avada-tgm-plugin-activation.php
[edit]
[-] class-fusion-builder-migrate.php
[edit]
[-] class-avada-social-sharing.php
[edit]
[-] class-fusion-builder-filters.php
[edit]
[+]
lib
[+]
typography
[-] class-avada-dynamic-css.php
[edit]
[-] class-avada-page-options.php
[edit]
[-] custom_functions.php
[edit]
[-] class-avada-options.php
[edit]
[-] avada-tgm.php
[edit]
[-] class-avada-portfolio.php
[edit]
[-] class-avada-upgrade.php
[edit]
[-] dynamic_css_helpers.php
[edit]
[-] class-avada-eventscalendar.php
[edit]
[-] class-avada-taxonomy-meta.php
[edit]
[-] class-avada-sidebars.php
[edit]
[-] class-fusion-gfonts-downloader.php
[edit]
[-] class-avada-widget-style.php
[edit]
[-] class-avada-admin-notices.php
[edit]
[-] class-avada-social-icons.php
[edit]
[-] class-avada-fonts.php
[edit]
[-] class-avada-scripts.php
[edit]
[-] class-avada-autoload.php
[edit]
[-] class-avada-social-icon.php
[edit]
[-] class-avada-woocommerce.php
[edit]
[-] class-avada-images.php
[edit]
[-] class-fusion-image-resizer.php
[edit]
[-] class-avada-system-status.php
[edit]
[-] class-avada-google-fonts.php
[edit]
[-] dynamic_css.php
[edit]
[+]
widget
[-] class-avada-helper.php
[edit]
[-] class-avada-layout.php
[edit]
[-] class-avada-megamenu-framework.php
[edit]
[-] class-avada-avadaredux-migration.php
[edit]
[-] class-avada-gravity-forms-tags-merger.php
[edit]
[-] deprecated.php
[edit]
[+]
admin-screens
[-] class-avada-layout-bbpress.php
[edit]
[-] class-avada-settings.php
[edit]
[-] class-avada-init.php
[edit]
[-] class-avada.php
[edit]
[-] class-fusion-builder-demos-importer.php
[edit]
[+]
plugins
[+]
recaptcha