• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

WordPress Security Standards want me to escape my html, but how to do it correctly?

phpwordpresselementorcodesniffer


PHP Snippet 1:

$output = "<HTML>
    <form>
        <div>
            <label>$i_am</label>
            <input type='text' name='i_am' value='' />
        </div>
        <div>
            <label>$and_i_am_looking_for</label>
            <input type='text' name='and_i_am_looking_for' value='' />
        </div>
    </form>
</HTML>";

PHP Snippet 2:

echo wp_kses(
    $output,
    array(
        'form'  => array(),
        'div'   => array(),
        'label' => array(),
        'input' => array(
            'type',
            'name',
            'value',
        ),
    )
);

Related Snippets

how to fix Service provider class not found when using repository?

Problem with fetching data from database in Laravel

How to get values inside <![CDATA[values]] > using php DOM?

Yii2: How do I debug console commands?

Unable to match results of php hash_hmac() and coldfusion hmac()

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

Fatal error: Uncaught mysqli_sql_exception: Unknown database 'test' in ... (How do I fix that? Using PHP)

dockerizing Laravel + vue

I can't delete my image when it is liked because of the foreign key in mysql

How to insert Google Adsense Code in PHP script?

Composer fails with kylekatarnls/update-helper on new homestead

how to create html table in php

args[max_input] woocommerce if statement confused

Assign output of PHP function to a variable

Show rotation of tweets using current day of month

About Contact Privacy policy Terms and conditions