get_data(); if( empty( $generalList['social_share']['share_platforms_to_product_page'] ) || 'on' !== $generalList['social_share']['share_platforms_to_product_page'] || empty( $generalList['social_share']['share_platforms'] ) ){ return; } $share_platforms = []; foreach ( $generalList['social_share']['share_platforms'] as $value ){ $share_platforms[$value] = [ 'share_items' => $value, 'share_text' => ucwords( $value ), ]; } $settings['share_platforms'] = $share_platforms; $settings['layout'] = ! empty( $generalList['social_share']['share_icon_layout'] ) ? $generalList['social_share']['share_icon_layout'] : 1 ; $settings['show_share_icon'] = 1;// TODO:: Implement Later ! empty( $generalList['social_share']['share_icon_show_to_product_page'] ) && 'on' === $generalList['social_share']['share_icon_show_to_product_page']; Fns::print_html( Render::instance()->social_share_view( 'elementor/general/social-share', $settings ), true ); } /** * Meta tags for social sharing. * * @return void */ public static function og_metatags_for_sharing() { global $post; if ( ! isset( $post ) ) { return; } if ( ! is_singular( 'product' ) ) { return; } Fns::print_html( '', true ); Fns::print_html( '', true ); Fns::print_html( '', true ); Fns::print_html( '' ); $attachment = get_the_post_thumbnail_url(); if ( ! empty( $attachment ) ) { Fns::print_html( '', true ); } Fns::print_html( '', true ); Fns::print_html( '', true ); } }