allowed_tags

Display all of the allowed tags in HTML format with attributes.

Description

(string) allowed_tags(); 

This is useful for displaying in the comment area, which elements and attributes are supported. As well as any plugins which want to display it.

Returns (string)

HTML allowed tags entity encoded.


Usage

  1. if ( !function_exists( 'allowed_tags' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = allowed_tags(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/general-template.php  
  1. function allowed_tags() { 
  2. global $allowedtags; 
  3. $allowed = ''; 
  4. foreach ( (array) $allowedtags as $tag => $attributes ) { 
  5. $allowed .= '<'.$tag; 
  6. if ( 0 < count($attributes) ) { 
  7. foreach ( $attributes as $attribute => $limits ) { 
  8. $allowed .= ' '.$attribute.'=""'; 
  9. $allowed .= '> '; 
  10. return htmlentities( $allowed );