• 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 change 'users' auth table and use another instead Laravel

Get WooCommerce product variation attribute terms in admin products general box

Remove product downloads section in woocommerce email notifications

WooCommerce Additional Information - if empty, hide

How do I loop through an MS SQL database with VB.NET?

Populate Dynamic Dropdowns List in Codeigniter

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

Do I need to install `fxp/composer-asset-plugin` if I'm not doing front-end development

PHP mail function is sending blank message body

Telegram bot doesn't answer

Can I use a WooCommerce function without any WooCommerce page?

PHP Fatal error: Class not found - PHPUnit

"cannot list resources" error from WooCommerce REST API

Laravel - Implicit route model binding with soft deleted data

php curl requesting twice

About Contact Privacy policy Terms and conditions