• I have a function similar to this in my functions.php file:

    <?php
    if ( ! function_exists( 'fun_list' ) ) :
    function size_list( $type ) { ?>
    		<ul class="<?php echo esc_html( $type ) ?>-list">
    			<li><a href="#">Small</a></li>
    			<li><a href="#">Medium</a></li>
    			<li><a href="#">Large</a></li>
    		</ul>
    <?php }
    endif; ?>

    I call this function from within my template files like so:

    <?php size_list( "main" ) ?>

    I’m quite confused about what actually needs to be escaped, is esc_html necessary in my function?

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

The topic ‘Do I need to escape this?’ is closed to new replies.