]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/default-filters.php
Wordpress 2.0.11
[autoinstalls/wordpress.git] / wp-includes / default-filters.php
1 <?php
2
3 // Some default filters
4 add_filter('bloginfo','wp_specialchars');
5 add_filter('category_description', 'wptexturize');
6 add_filter('list_cats', 'wptexturize');
7 add_filter('comment_author', 'wptexturize');
8 add_filter('comment_text', 'wptexturize');
9 add_filter('single_post_title', 'wptexturize');
10 add_filter('the_title', 'wptexturize');
11 add_filter('the_content', 'wptexturize');
12 add_filter('the_excerpt', 'wptexturize');
13 add_filter('bloginfo', 'wptexturize');
14
15 // Comments, trackbacks, pingbacks
16 add_filter('pre_comment_author_name', 'strip_tags');
17 add_filter('pre_comment_author_name', 'trim');
18 add_filter('pre_comment_author_name', 'wp_specialchars', 30);
19
20 add_filter('pre_comment_author_email', 'trim');
21 add_filter('pre_comment_author_email', 'sanitize_email');
22
23 add_filter('pre_comment_author_url', 'strip_tags');
24 add_filter('pre_comment_author_url', 'trim');
25 add_filter('pre_comment_author_url', 'clean_url');
26
27 add_filter('pre_comment_content', 'stripslashes', 1);
28 add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
29 add_filter('pre_comment_content', 'balanceTags', 30);
30 add_filter('pre_comment_content', 'addslashes', 50);
31
32 add_filter('pre_comment_author_name', 'wp_filter_kses');
33 add_filter('pre_comment_author_email', 'wp_filter_kses');
34 add_filter('pre_comment_author_url', 'wp_filter_kses');
35
36 add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce');
37
38 // Default filters for these functions
39 add_filter('comment_author', 'wptexturize');
40 add_filter('comment_author', 'convert_chars');
41 add_filter('comment_author', 'wp_specialchars');
42
43 add_filter('comment_email', 'antispambot');
44
45 add_filter('comment_url', 'clean_url');
46
47 add_filter('comment_text', 'convert_chars');
48 add_filter('comment_text', 'make_clickable');
49 add_filter('comment_text', 'force_balance_tags', 25);
50 add_filter('comment_text', 'wpautop', 30);
51 add_filter('comment_text', 'convert_smilies', 20);
52
53 add_filter('comment_excerpt', 'convert_chars');
54
55 // Categories
56 add_filter('pre_category_name', 'strip_tags');
57 add_filter('pre_category_name', 'trim');
58 add_filter('pre_category_name', 'wp_filter_kses');
59 add_filter('pre_category_name', 'wp_specialchars', 30);
60 add_filter('pre_category_description', 'wp_filter_kses');
61
62 //Links
63 add_filter('pre_link_name', 'strip_tags');
64 add_filter('pre_link_name', 'trim');
65 add_filter('pre_link_name', 'wp_filter_kses');
66 add_filter('pre_link_name', 'wp_specialchars', 30);
67 add_filter('pre_link_description', 'wp_filter_kses');
68 add_filter('pre_link_notes', 'wp_filter_kses');
69 add_filter('pre_link_url', 'strip_tags');
70 add_filter('pre_link_url', 'trim');
71 add_filter('pre_link_url', 'clean_url');
72 add_filter('pre_link_image', 'strip_tags');
73 add_filter('pre_link_image', 'trim');
74 add_filter('pre_link_image', 'clean_url');
75 add_filter('pre_link_rss', 'strip_tags');
76 add_filter('pre_link_rss', 'trim');
77 add_filter('pre_link_rss', 'clean_url');
78 add_filter('pre_link_target', 'strip_tags');
79 add_filter('pre_link_target', 'trim');
80 add_filter('pre_link_target', 'wp_filter_kses');
81 add_filter('pre_link_target', 'wp_specialchars', 30);
82 add_filter('pre_link_rel', 'strip_tags');
83 add_filter('pre_link_rel', 'trim');
84 add_filter('pre_link_rel', 'wp_filter_kses');
85 add_filter('pre_link_rel', 'wp_specialchars', 30);
86
87 // Users
88 add_filter('pre_user_display_name', 'strip_tags');
89 add_filter('pre_user_display_name', 'trim');
90 add_filter('pre_user_display_name', 'wp_filter_kses');
91 add_filter('pre_user_display_name', 'wp_specialchars', 30);
92 add_filter('pre_user_first_name', 'strip_tags');
93 add_filter('pre_user_first_name', 'trim');
94 add_filter('pre_user_first_name', 'wp_filter_kses');
95 add_filter('pre_user_first_name', 'wp_specialchars', 30);
96 add_filter('pre_user_last_name', 'strip_tags');
97 add_filter('pre_user_last_name', 'trim');
98 add_filter('pre_user_last_name', 'wp_filter_kses');
99 add_filter('pre_user_last_name', 'wp_specialchars', 30);
100 add_filter('pre_user_nickname', 'strip_tags');
101 add_filter('pre_user_nickname', 'trim');
102 add_filter('pre_user_nickname', 'wp_filter_kses');
103 add_filter('pre_user_nickname', 'wp_specialchars', 30);
104 add_filter('pre_user_description', 'trim');
105 add_filter('pre_user_description', 'wp_filter_kses');
106 add_filter('pre_user_url', 'strip_tags');
107 add_filter('pre_user_url', 'trim');
108 add_filter('pre_user_url', 'clean_url');
109 add_filter('pre_user_email', 'trim');
110 add_filter('pre_user_email', 'sanitize_email');
111
112 // Places to balance tags on input
113 add_filter('content_save_pre', 'balanceTags', 50);
114 add_filter('excerpt_save_pre', 'balanceTags', 50);
115 add_filter('comment_save_pre', 'balanceTags', 50);
116
117 // Misc. title, content, and excerpt filters
118 add_filter('the_title', 'convert_chars');
119 add_filter('the_title', 'trim');
120
121 add_filter('the_content', 'convert_smilies');
122 add_filter('the_content', 'convert_chars');
123 add_filter('the_content', 'wpautop');
124
125 add_filter('the_excerpt', 'convert_smilies');
126 add_filter('the_excerpt', 'convert_chars');
127 add_filter('the_excerpt', 'wpautop');
128 add_filter('get_the_excerpt', 'wp_trim_excerpt');
129
130 add_filter('sanitize_title', 'sanitize_title_with_dashes');
131
132 // RSS filters
133 add_filter('the_title_rss', 'strip_tags');
134 add_filter('the_title_rss', 'ent2ncr', 8);
135 add_filter('the_title_rss', 'wp_specialchars');
136 add_filter('the_content_rss', 'ent2ncr', 8);
137 add_filter('the_excerpt_rss', 'convert_chars');
138 add_filter('the_excerpt_rss', 'ent2ncr', 8);
139 add_filter('comment_author_rss', 'ent2ncr', 8);
140 add_filter('comment_text_rss', 'wp_specialchars');
141 add_filter('comment_text_rss', 'ent2ncr', 8);
142 add_filter('bloginfo_rss', 'ent2ncr', 8);
143 add_filter('the_author', 'ent2ncr', 8);
144
145 // Misc filters
146 add_filter('option_blog_charset', 'wp_specialchars');
147
148 // Actions
149 add_action('publish_post', 'generic_ping');
150 add_action('wp_head', 'rsd_link');
151 add_action('sanitize_comment_cookies', 'sanitize_comment_cookies');
152
153 ?>