File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,8 +92,10 @@ function wp_insert_category($catarr) {
9292 else
9393 $ update = false ;
9494
95- $ cat_name = wp_specialchars ($ cat_name );
96-
95+ $ cat_name = apply_filters ('pre_category_name ' , $ cat_name );
96+ $ category_nicename = apply_filters ('pre_category_nicename ' , $ category_nicename );
97+ $ category_description = apply_filters ('pre_category_description ' , $ category_description );
98+
9799 if (empty ($ category_nicename ))
98100 $ category_nicename = sanitize_title ($ cat_name );
99101 else
@@ -102,6 +104,7 @@ function wp_insert_category($catarr) {
102104 if (empty ($ category_description ))
103105 $ category_description = '' ;
104106
107+ $ category_parent = (int ) $ category_parent ;
105108 if (empty ($ category_parent ))
106109 $ category_parent = 0 ;
107110
Original file line number Diff line number Diff line change 4949
5050add_filter ('comment_excerpt ' , 'convert_chars ' );
5151
52+ // Categories
53+ add_filter ('pre_category_name ' , 'strip_tags ' );
54+ add_filter ('pre_category_name ' , 'trim ' );
55+ add_filter ('pre_category_name ' , 'wp_filter_kses ' );
56+ add_filter ('pre_category_name ' , 'wp_specialchars ' , 30 );
57+ add_filter ('pre_category_description ' , 'wp_filter_kses ' );
58+
5259// Places to balance tags on input
5360add_filter ('content_save_pre ' , 'balanceTags ' , 50 );
5461add_filter ('excerpt_save_pre ' , 'balanceTags ' , 50 );
You can’t perform that action at this time.
0 commit comments