HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/diasporameetsafrica.com/wp-content/plugins/lavelo-core/include/theme-functions.php
<?php

/**
 * Plugin language
 */
function lavelo_plugin_language_setup()
{
  load_plugin_textdomain('lavelo-core', false, dirname(plugin_basename(__FILE__)) . '/languages');
}
add_action('init', 'lavelo_plugin_language_setup');

/* WPAUTOP for shortcode output */
if (!function_exists('lavelo_set_wpautop')) {
  function lavelo_set_wpautop($content, $force = true)
  {
    if ($force) {
      $content = wpautop(preg_replace('/<\/?p\>/', "\n", $content) . "\n");
    }
    return do_shortcode(shortcode_unautop($content));
  }
}

/* Use shortcodes in text widgets */
add_filter('widget_text', 'do_shortcode');

/* Shortcodes enable in the_excerpt */
add_filter('the_excerpt', 'do_shortcode');

/* Remove p tag and add by our self in the_excerpt */
remove_filter('the_excerpt', 'wpautop');


/* Add Extra Social Fields in Admin User Profile */
function lavelo_add_twitter_facebook($contactmethods)
{
  $contactmethods['twitter']    = 'Twitter';
  $contactmethods['facebook']   = 'Facebook';
  $contactmethods['instagram']  = 'Instagram';
  $contactmethods['pinterest']   = 'Pinterest';
  return $contactmethods;
}
add_filter('user_contactmethods', 'lavelo_add_twitter_facebook', 10, 1);

/**
 *
 * Encode string for backup options
 *
 * @since 1.0.0
 * @version 1.0.0
 *
 */
if (!function_exists('cs_encode_string')) {
  function cs_encode_string($string)
  {
    return rtrim(strtr(call_user_func('base' . '64' . '_encode', addslashes(gzcompress(serialize($string), 9))), '+/', '-_'), '=');
  }
}

/**
 *
 * Decode string for backup options
 *
 * @since 1.0.0
 * @version 1.0.0
 *
 */
if (!function_exists('cs_decode_string')) {
  function cs_decode_string($string)
  {
    return unserialize(gzuncompress(stripslashes(call_user_func('base' . '64' . '_decode', rtrim(strtr($string, '-_', '+/'), '=')))));
  }
}


/* Inline Style */
global $all_inline_styles;
$all_inline_styles = array();
if (!function_exists('add_inline_style')) {
  function add_inline_style($style)
  {
    global $all_inline_styles;
    array_push($all_inline_styles, $style);
  }
}

/* Enqueue Inline Styles */
if (!function_exists('lavelo_enqueue_inline_styles')) {
  function lavelo_enqueue_inline_styles()
  {

    global $all_inline_styles;

    if (!empty($all_inline_styles)) {
      echo '<style id="lavelo-inline-style" type="text/css">' . lavelo_compress_css_lines(join('', $all_inline_styles)) . '</style>';
    }
  }
  add_action('wp_footer', 'lavelo_enqueue_inline_styles');
}

/* Validate px entered in field */
if (!function_exists('lavelo_core_check_px')) {
  function lavelo_core_check_px($num)
  {
    return (is_numeric($num)) ? $num . 'px' : $num;
  }
}


/* Share Options */
if (!function_exists('lavelo_wp_share_option')) {
  function lavelo_wp_share_option()
  {

    global $post;
    $page_url = get_permalink($post->ID);
    $title = $post->post_title;
    $share_text = cs_get_option('share_text');
    $share_text = $share_text ? $share_text : esc_html__('Share', 'lavelo');
    $share_on_text = cs_get_option('share_on_text');
    $share_on_text = $share_on_text ? $share_on_text : esc_html__('Share On', 'lavelo');
?>
    <div class="share">
      <i class="fa fa-share-alt"></i>
      <ul>
        <li><?php echo esc_attr($share_text); ?>:</li>
        <li>
          <a href="//twitter.com/home?status=<?php print(urlencode($title)); ?>+<?php print(urlencode($page_url)); ?>" class="icon-fa-twitter" data-toggle="tooltip" data-placement="top" title="<?php echo esc_attr($share_on_text . ' ');
                                                                                                                                                                                                  echo esc_attr('Twitter', 'lavelo'); ?>" target="_blank"><i class="fa fa-twitter"></i></a>
        </li>
        <li>
          <a href="//www.facebook.com/sharer/sharer.php?u=<?php print(urlencode($page_url)); ?>&amp;t=<?php print(urlencode($title)); ?>" class="icon-fa-facebook" data-toggle="tooltip" data-placement="top" title="<?php echo esc_attr($share_on_text . ' ');
                                                                                                                                                                                                                      echo esc_attr('Facebook', 'lavelo'); ?>" target="_blank"><i class="fa fa-facebook"></i></a>
        </li>
        <li>
          <a href="//www.linkedin.com/shareArticle?mini=true&amp;url=<?php print(urlencode($page_url)); ?>&amp;title=<?php print(urlencode($title)); ?>" class="icon-fa-linkedin" data-toggle="tooltip" data-placement="top" title="<?php echo esc_attr($share_on_text . ' ');
                                                                                                                                                                                                                                    echo esc_attr('Linkedin', 'lavelo'); ?>" target="_blank"><i class="fa fa-linkedin"></i></a>
        </li>
        <li>
          <a href="//plus.google.com/share?url=<?php print(urlencode($page_url)); ?>" class="icon-fa-google-plus" data-toggle="tooltip" data-placement="top" title="<?php echo esc_attr($share_on_text . ' ');
                                                                                                                                                                    echo esc_attr('Google+', 'lavelo'); ?>" target="_blank"><i class="fa fa-google-plus"></i></a>
        </li>
      </ul>
    </div>
<?php
  }
}