How to customize a default label

How to customize a default label

Sometimes you need to change the default Label used on a button.

In some situations like for the listing slider, you can specify it in the shortcode like this
  1. [si_list_slider type="hero" limit="5" detail_label="Details" show_navigation="true" auto="true" height="500px"]

When not available in the shortcode, you will need to use the si/label filter and add the following code in your theme's function.php file :
  1. apply_filters('si/label', 'customLabelMapping');
  2. function customLabelMapping($label) {
  3.     $labelMap = [
  4.         'View detail' => 'Details',
  5.         'Voir les détails' => 'Détails',

  6.         // Add more label mappings here as needed
  7.     ];

  8.     if(isset($labelMap[$label])){
  9.         return $labelMap[$label];
  10.     }
  11.     return $label;
  12. }