• Resolved andygroove

    (@andygroove)


    Hello
    help me please
    How to translate range chips min max meta_key values (example from “Max price 3333” to “Цена 3333”)?
    EXAMPLE
    WPML doesnt define this parameters
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author stepasyuk

    (@stepasyuk)

    Hello @andygroove

    Did you read this article about hooks https://filtereverything.pro/resources/hooks/ ?

    Here is hook called 'wpc_filter_post_meta_num_term_name' that allows you to change range slider term names.

    • This reply was modified 3 years, 2 months ago by stepasyuk.
    Thread Starter andygroove

    (@andygroove)

    Thankssss
    I read this article about hooks but dont understand how to do this
    please I need help so much
    example code
    how to do the same chips
    1 examp
    or
    1 examp

    Plugin Author stepasyuk

    (@stepasyuk)

    No problems @andygroove take it from there
    https://gist.github.com/wpserve/6f9c9ce6e0c4cfd22ebace936537c8d5 or here

    <?php
    
    add_filter( 'wpc_filter_post_meta_num_term_name', 'wpc_custom_post_meta_num_term_name', 10, 2 );
    function wpc_custom_post_meta_num_term_name( $term_name, $e_name ){
        if( $e_name === '_price' ){
            if( strpos( $term_name, 'Min price' ) !== false ){
                $term_name = str_replace( 'Min price', 'Цена от', $term_name );
                $term_name .= ' руб.';
            }
    
            if( strpos( $term_name, 'Max price' ) !== false ){
                $term_name = str_replace( 'Max price', 'Цена до', $term_name );
                $term_name .= ' руб.';
            }
        }
    
        return $term_name;
    }
    
    ?>

    And replace with your values if you need.

    P.S. Best thanks for a plugin developer is review about his plugin ??

    Thread Starter andygroove

    (@andygroove)

    Thank you so much from Ukraine
    Good luck
    5 stars

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Translate range chips’ is closed to new replies.