]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/default-filters.php
Wordpress 2.0.2-scripts
[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', 'wpautop', 30);
48 add_filter('comment_text', 'convert_smilies', 20);
49
50 add_filter('comment_excerpt', 'convert_chars');
51
52 // Places to balance tags on input
53 add_filter('content_save_pre', 'balanceTags', 50);
54 add_filter('excerpt_save_pre', 'balanceTags', 50);
55 add_filter('comment_save_pre', 'balanceTags', 50);
56
57 // Misc. title, content, and excerpt filters
58 add_filter('the_title', 'convert_chars');
59 add_filter('the_title', 'trim');
60
61 add_filter('the_content', 'convert_smilies');
62 add_filter('the_content', 'convert_chars');
63 add_filter('the_content', 'wpautop');
64
65 add_filter('the_excerpt', 'convert_smilies');
66 add_filter('the_excerpt', 'convert_chars');
67 add_filter('the_excerpt', 'wpautop');
68 add_filter('get_the_excerpt', 'wp_trim_excerpt');
69
70 add_filter('sanitize_title', 'sanitize_title_with_dashes');
71
72 // RSS filters
73 add_filter('the_title_rss', 'strip_tags');
74 add_filter('the_title_rss', 'ent2ncr', 8);
75 add_filter('the_content_rss', 'ent2ncr', 8);
76 add_filter('the_excerpt_rss', 'convert_chars');
77 add_filter('the_excerpt_rss', 'ent2ncr', 8);
78 add_filter('comment_author_rss', 'ent2ncr', 8);
79 add_filter('comment_text_rss', 'htmlspecialchars');
80 add_filter('comment_text_rss', 'ent2ncr', 8);
81 add_filter('bloginfo_rss', 'ent2ncr', 8);
82 add_filter('the_author', 'ent2ncr', 8);
83
84 // Actions
85 add_action('publish_post', 'generic_ping');
86 add_action('wp_head', 'rsd_link');
87
88 ?>