mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Add some category filters.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e7618712cb
commit
70276282ad
@ -92,7 +92,9 @@ function wp_insert_category($catarr) {
|
||||
else
|
||||
$update = false;
|
||||
|
||||
$cat_name = wp_specialchars($cat_name);
|
||||
$cat_name = apply_filters('pre_category_name', $cat_name);
|
||||
$category_nicename = apply_filters('pre_category_nicename', $category_nicename);
|
||||
$category_description = apply_filters('pre_category_description', $category_description);
|
||||
|
||||
if (empty ($category_nicename))
|
||||
$category_nicename = sanitize_title($cat_name);
|
||||
@ -102,6 +104,7 @@ function wp_insert_category($catarr) {
|
||||
if (empty ($category_description))
|
||||
$category_description = '';
|
||||
|
||||
$category_parent = (int) $category_parent;
|
||||
if (empty ($category_parent))
|
||||
$category_parent = 0;
|
||||
|
||||
|
@ -47,6 +47,13 @@ add_filter('comment_text', 'convert_smilies', 20);
|
||||
|
||||
add_filter('comment_excerpt', 'convert_chars');
|
||||
|
||||
// Categories
|
||||
add_filter('pre_category_name', 'strip_tags');
|
||||
add_filter('pre_category_name', 'trim');
|
||||
add_filter('pre_category_name', 'wp_filter_kses');
|
||||
add_filter('pre_category_name', 'wp_specialchars', 30);
|
||||
add_filter('pre_category_description', 'wp_filter_kses');
|
||||
|
||||
// Places to balance tags on input
|
||||
add_filter('content_save_pre', 'balanceTags', 50);
|
||||
add_filter('excerpt_save_pre', 'balanceTags', 50);
|
||||
|
Loading…
Reference in New Issue
Block a user