]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/default-filters.php
Wordpress 2.0.4
[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 // Default filters for these functions
37 add_filter('comment_author', 'wptexturize');
38 add_filter('comment_author', 'convert_chars');
39 add_filter('comment_author', 'wp_specialchars');
40
41 add_filter('comment_email', 'antispambot');
42
43 add_filter('comment_url', 'clean_url');
44
45 add_filter('comment_text', 'convert_chars');
46 add_filter('comment_text', 'make_clickable');
47 add_filter('comment_text', 'force_balance_tags', 25);
48 add_filter('comment_text', 'wpautop', 30);
49 add_filter('comment_text', 'convert_smilies', 20);
50
51 add_filter('comment_excerpt', 'convert_chars');
52
53 // Categories
54 add_filter('pre_category_name', 'strip_tags');
55 add_filter('pre_category_name', 'trim');
56 add_filter('pre_category_name', 'wp_filter_kses');
57 add_filter('pre_category_name', 'wp_specialchars', 30);
58 add_filter('pre_category_description', 'wp_filter_kses');
59
60 // Users
61 add_filter('pre_user_display_name', 'strip_tags');
62 add_filter('pre_user_display_name', 'trim');
63 add_filter('pre_user_display_name', 'wp_filter_kses');
64 add_filter('pre_user_display_name', 'wp_specialchars', 30);
65 add_filter('pre_user_first_name', 'strip_tags');
66 add_filter('pre_user_first_name', 'trim');
67 add_filter('pre_user_first_name', 'wp_filter_kses');
68 add_filter('pre_user_first_name', 'wp_specialchars', 30);
69 add_filter('pre_user_last_name', 'strip_tags');
70 add_filter('pre_user_last_name', 'trim');
71 add_filter('pre_user_last_name', 'wp_filter_kses');
72 add_filter('pre_user_last_name', 'wp_specialchars', 30);
73 add_filter('pre_user_nickname', 'strip_tags');
74 add_filter('pre_user_nickname', 'trim');
75 add_filter('pre_user_nickname', 'wp_filter_kses');
76 add_filter('pre_user_nickname', 'wp_specialchars', 30);
77 add_filter('pre_user_description', 'trim');
78 add_filter('pre_user_description', 'wp_filter_kses');
79 add_filter('pre_user_url', 'strip_tags');
80 add_filter('pre_user_url', 'trim');
81 add_filter('pre_user_url', 'clean_url');
82 add_filter('pre_user_email', 'trim');
83 add_filter('pre_user_email', 'sanitize_email');
84
85 // Places to balance tags on input
86 add_filter('content_save_pre', 'balanceTags', 50);
87 add_filter('excerpt_save_pre', 'balanceTags', 50);
88 add_filter('comment_save_pre', 'balanceTags', 50);
89
90 // Misc. title, content, and excerpt filters
91 add_filter('the_title', 'convert_chars');
92 add_filter('the_title', 'trim');
93
94 add_filter('the_content', 'convert_smilies');
95 add_filter('the_content', 'convert_chars');
96 add_filter('the_content', 'wpautop');
97
98 add_filter('the_excerpt', 'convert_smilies');
99 add_filter('the_excerpt', 'convert_chars');
100 add_filter('the_excerpt', 'wpautop');
101 add_filter('get_the_excerpt', 'wp_trim_excerpt');
102
103 add_filter('sanitize_title', 'sanitize_title_with_dashes');
104
105 // RSS filters
106 add_filter('the_title_rss', 'strip_tags');
107 add_filter('the_title_rss', 'ent2ncr', 8);
108 add_filter('the_title_rss', 'wp_specialchars');
109 add_filter('the_content_rss', 'ent2ncr', 8);
110 add_filter('the_excerpt_rss', 'convert_chars');
111 add_filter('the_excerpt_rss', 'ent2ncr', 8);
112 add_filter('comment_author_rss', 'ent2ncr', 8);
113 add_filter('comment_text_rss', 'wp_specialchars');
114 add_filter('comment_text_rss', 'ent2ncr', 8);
115 add_filter('bloginfo_rss', 'ent2ncr', 8);
116 add_filter('the_author', 'ent2ncr', 8);
117
118 // Actions
119 add_action('publish_post', 'generic_ping');
120 add_action('wp_head', 'rsd_link');
121 add_action('sanitize_comment_cookies', 'sanitize_comment_cookies');
122
123 ?>