• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

関数リファレンス/wp kses allowed html

提供: WordPress Codex 日本語版
移動先: 案内検索

Description

Return a list of allowed tags and attributes for a given context.

This is filtered by the wp_kses_allowed_html hook which provides you with an easy way to change what is allowed html

Usage

<?php $allowed_tags = wp_kses_allowed_html( $context ); ?>

Parameters

$context
mixed) (required) The context for which to retrieve tags. Allowed values are post, strip, data, entities or the name of a field filter such as pre_user_description.
初期値: なし

Return

Returns the list of allowed HTML tags for a given context. The Return value is a multidimensional array with the tag name as the key and an array of attributes as the value.

<?php
$allowed_tags = wp_kses_allowed_html( 'post' );
var_dump( $allowed_tags );
/*
array(74) {
	['address'] => array(4) {
		['class'] => bool(true)
		['id']    => bool(true)
		['style'] => bool(true)
		['title'] => bool(true)
	}
	...
	['var'] = >array(4) {
		['class'] => bool(true)
		['id']    => bool(true)
		['style'] => bool(true)
		['title'] => bool(true)
	}
}
*/

Examples

Notes

Changelog

Source File

wp_kses_allowed_html() is located in wp-includes/kses.php.

Related

Data Validation


関数リファレンステンプレートタグ目次もご覧ください。


最新英語版: WordPress Codex » Function Reference/wp_kses_allowed_html最新版との差分