Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author annastaa

    (@annastaa)

    Hello @miroslaw89,

    While there is no built-in option for “Filters” toggle button label customization, there still exist 2 ways of customizing it:

    1. If you use a child theme, you can change the label by adding the following filter to the functions.php of your child theme:

    add_filter( 'awf_js_data', function( $js_data ) {
        $js_data['i18n']['togglable_preset_btn_label'] = 'Your label here';
     
        return $js_data;
    } );

    This way you can also use the WordPress localization functions.

    2. The second way is by adding the following code into the annasta Filters > Plugin settings > Custom Javascript box:

    jQuery( document ).ready( function( $ ){
      if( typeof( awf_data ) !== 'undefined' && 'togglable_preset' in awf_data ) {
          
          awf_data.i18n.togglable_preset_btn_label = 'Your label here';
          var $filters_button = $( '.awf-togglable-preset-btn' ).first();
     
          if( 0 < $filters_button.length ) {
              $filters_button.find( 'span').text( awf_data.i18n.togglable_preset_btn_label );
          }
     
      }
    });

    Whichever way you choose, please replace the Your label here part with the needed label.

    Thread Starter miroslaw89

    (@miroslaw89)

    Perfect. It’s the better solution! Thanks!

    • This reply was modified 3 years, 8 months ago by miroslaw89.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change mobile button text’ is closed to new replies.