• 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 check version of codeigniter framework?

PHP SoapClient: set a namespace without prefix

Invalid value in field "itemtype" in Google Search Console

How to add class name to an existing tag in php

How to check user Permissions using Custom Middleware in Laravel

PHP Fatal error: Class not found - PHPUnit

api response laravel doesn't show

Fetch files from next cloud storage and display in Laravel website

Can't exclude directories from .htaccess mobile redirect?

Extract house numbers from address string

Timber: Single post pagination does not work (wp_link_pages)

"properties should not be accessed directly" issue during WooCommerce 3.0 checkout

How to make a foreign key not using primary key

How to set a domain name with php artisan serve

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

About Contact Privacy policy Terms and conditions