From the course: WordPress Development: Coding Practice

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Sanitize output

Sanitize output

- [Instructor] Sanitization is a two-way street. Now let's say you're pulling information from the database, again, the text will actually be provided. You want to make sure that the information from the database will not break your site, so you're going to want to escape this output. So given the provided output, use the proper escape functions to make sure we display clean text to the end user. Format the text as such: a heading with the name, linked to the provided URL, and then a separate paragraph with the email address, and that does not have to be linked. We will use a short code to display the output. Remember, there are different escape functions for different types of data. So with that, let's take a look at our starting code. You can see here that we have a name, email, and URL that all need to be escaped before we return it as output. So go ahead and pause the video here and when you are ready, come back to see…

Contents