| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/infrafs/www/wp-content/plugins/eltd-core/shortcodes/social-share/ |
Upload File : |
<?php
if ( ! function_exists( 'eltd_core_add_social_share_shortcodes' ) ) {
function eltd_core_add_social_share_shortcodes( $shortcodes_class_name ) {
$shortcodes = array(
'ElatedCore\CPT\Shortcodes\SocialShare\SocialShare'
);
$shortcodes_class_name = array_merge( $shortcodes_class_name, $shortcodes );
return $shortcodes_class_name;
}
add_filter( 'eltd_core_filter_add_vc_shortcode', 'eltd_core_add_social_share_shortcodes' );
}
if ( ! function_exists( 'eltd_core_set_social_share_icon_class_name_for_vc_shortcodes' ) ) {
/**
* Function that set custom icon class name for social share shortcode to set our icon for Visual Composer shortcodes panel
*/
function eltd_core_set_social_share_icon_class_name_for_vc_shortcodes( $shortcodes_icon_class_array ) {
$shortcodes_icon_class_array[] = '.icon-wpb-social-share';
return $shortcodes_icon_class_array;
}
add_filter( 'eltd_core_filter_add_vc_shortcodes_custom_icon_class', 'eltd_core_set_social_share_icon_class_name_for_vc_shortcodes' );
}
if ( ! function_exists( 'trackstore_elated_get_social_share_html' ) ) {
/**
* Calls button shortcode with given parameters and returns it's output
*
* @param $params
* @return mixed|string
*/
function trackstore_elated_get_social_share_html( $params = array() ) {
if ( trackstore_elated_core_plugin_installed() ) {
return trackstore_elated_execute_shortcode( 'eltd_social_share', $params );
}
}
}
if ( ! function_exists( 'trackstore_elated_the_excerpt_max_charlength' ) ) {
/**
* Function that sets character length for social share shortcode
*
* @param $charlength string original text
* @return string shortened text
*/
function trackstore_elated_the_excerpt_max_charlength( $charlength ) {
$twitter_via_meta = trackstore_elated_options()->getOptionValue( 'twitter_via' );
$via = ! empty( $twitter_via_meta ) ? ' via ' . esc_attr( $twitter_via_meta ) : '';
$excerpt_text = get_the_excerpt();
$excerpt = esc_html( strip_shortcodes( $excerpt_text ) );
$charlength = 139 - ( mb_strlen( $via ) + $charlength );
if ( mb_strlen( $excerpt ) > $charlength ) {
$subex = mb_substr( $excerpt, 0, $charlength );
$exwords = explode( ' ', $subex );
$excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) );
if ( $excut < 0 ) {
return mb_substr( $subex, 0, $excut );
} else {
return $subex;
}
} else {
return $excerpt;
}
}
}