wp-includes/kses.php


Lines:

1 to 100 of 786
<?php

/**
 * kses 0.2.2 - HTML/XHTML filter that only allows some elements and attributes
 * Copyright (C) 2002, 2003, 2005  Ulf Harnhammar
 *
 * This program is free software and open source software; you can redistribute
 * it and/or modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the License,
 * or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 * http://www.gnu.org/licenses/gpl.html
 *
 * [kses strips evil scripts!]
 *
 * Added wp_ prefix to avoid conflicts with existing kses users
 *
 * @version 0.2.2
 * @copyright (C) 2002, 2003, 2005
 * @author Ulf Harnhammar <http://advogato.org/person/metaur/>
 *
 * @package External
 * @subpackage KSES
 */


/**
 * Specifies the default allowable HTML tags.
 *
 * Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The
 * {@see 'wp_kses_allowed_html'} filter is more powerful and supplies context.
 *
 * @see wp_kses_allowed_html()
 * @since 1.2.0
 *
 * @var array[]|false Array of default allowable HTML tags, or false to use the defaults.
 */
if ( ! defined( 'CUSTOM_TAGS' ) ) {
  define( 'CUSTOM_TAGS', false );
}

// Ensure that these variables are added to the global namespace
// (e.g. if using namespaces / autoload in the current PHP environment).
global $allowedposttags, $allowedtags, $allowedentitynames, $allowedxmlentitynames;

if ( ! CUSTOM_TAGS ) {
  
/**
 * KSES global for default allowable HTML tags.
 *
 * Can be overridden with the `CUSTOM_TAGS` constant.
 *
 * @var array[] $allowedposttags Array of default allowable HTML tags.
 * @since 2.0.0
 */
  $allowedposttags = array(
    'address'    => array(),
    'a'          => array(
      'href'     => true,
      'rel'      => true,
      'rev'      => true,
      'name'     => true,
      'target'   => true,
      'download' => array(
        'valueless' => 'y',
      ),
    ),
    'abbr'       => array(),
    'acronym'    => array(),
    'area'       => array(
      'alt'    => true,
      'coords' => true,
      'href'   => true,
      'nohref' => true,
      'shape'  => true,
      'target' => true,
    ),
    'article'    => array(
      'align' => true,
    ),
    'aside'      => array(
      'align' => true,
    ),
    'audio'      => array(
      'autoplay' => true,
      'controls' => true,
      'loop'     => true,
      'muted'    => true,
      'preload'  => true,
      'src'      => true,
    ),
    'b'          => array(),

 View on GitHub View on Trac

Called by

    Invoked by

      Calls

      Call hooks

      API Letters: ,,,