• Halil Beycan

    (@beycandeveloper)


    Hello, using the esc_html__ function was tiring to write text domain all the time: D so I created a function as below.

    The problem is I can get the following word but it doesn’t save to .pot file. If I make a direct definition of esc_html__ in the function, it works but when I use variables for dynamics, what is the reason?

    // Working
    function lsph_lang(){
    return esc_html__( “Hello”, ‘lsph’ );
    }
    lsph_lang();

    // Not working.
    function lsph_lang( $str ){
    return esc_html__( $str, ‘lsph’ );
    }
    lsph_lang( “hello” );

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘About using wordpress esc_html__.’ is closed to new replies.