• 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

Using Associative arrays

phpunit - testing is painfully slow

How to disable only_full_group_by option in Laravel

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

virtctl works when executed via command line but not from php exec()

I want to display a sweetalert after the inserting of data in my database

WHERE IN array binding in DB::raw laravel 5.4

PHP - CURL using HTTPS [closed]

Laravel Pagination links() not working

SQL to convert multiple rows into a single row of variable length

How to Display Data in Yajra Datatables Laravel 7?

Insert multidimensional array to codeigniter cart

Wordpress wpdb->delete issue

CONCAT columns with Laravel 5 eloquent

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

About Contact Privacy policy Terms and conditions