1
vote
1answer
350 views

How to sanitize user input?

What is the correct way sanitizing form data before submitting to the database? I have the following text input: <form method="post" action="options.php"> <?php ...
1
vote
3answers
2k views

When do I need to use esc_attr when using WordPress internal functions

When I am putting a WordPress value inside the attribute tag, for example, the following method does not need esc_attr e.g. // JS code alert('<?php echo get_bloginfo('name');?>'); the ...