wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
sanitize_term [ WordPress Function ]
| Parameter: |
|
| Nutzt: | |
| Gibt zurück: |
|
| Definiert in: |
|
Sanitize Term all fields.
Relies on sanitize_term_field() to sanitize the term. The difference is that this function will sanitize all fields. The context is based on sanitize_term_field().
The $term is expected to be either an array or an object.
Source
<?php
function sanitize_term($term, $taxonomy, $context = 'display') {
if ( 'raw' == $context )
return $term;
$fields = array('term_id', 'name', 'description', 'slug', 'count', 'parent', 'term_group');
$do_object = false;
if ( is_object($term) )
$do_object = true;
$term_id = $do_object ? $term->term_id : (isset($term['term_id']) ? $term['term_id'] : 0);
foreach ( (array) $fields as $field ) {
if ( $do_object ) {
if ( isset($term->$field) )
$term->$field = sanitize_term_field($field, $term->$field, $term_id, $taxonomy, $context);
} else {
if ( isset($term[$field]) )
$term[$field] = sanitize_term_field($field, $term[$field], $term_id, $taxonomy, $context);
}
}
if ( $do_object )
$term->filter = $context;
else
$term['filter'] = $context;
return $term;
}
?>
Beispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- Function Reference/sanitize term « WordPress Codex
Description. Sanitize Term all fields. Relys on sanitize_term_field() to sanitize the term. The difference is that this function will sanitize all fields. The context is ...
codex.wordpress.org - #16864 (WP_Terms_List_Table doesn't call sanitize_term() on ...
Last modified 11 months ago. WP_Terms_List_Table doesn't call sanitize_term() on display. Reported by: scribu, Owned by: Priority: normal, Milestone: Awaiting ...
core.trac.wordpress.org - sanitize_term (WordPress Function) - WPSeek.com
WordPress lookup for sanitize_term, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - Docs for page functions.wp-taxonomy.php
void sanitize_term ( $term, $taxonomy, [ $context = 'display']). $term; $taxonomy; $context. sanitize_term_field (line 82). void sanitize_term_field ( $field, $value, ...
phpdoc.ftwr.co.uk