root/tags/1.5.1.3/wp-includes/default-filters.php

Revision 2517, 3.0 kB (checked in by ryan, 3 years ago)

Add entity 2 ncr converter. http://mosquito.wordpress.org/view.php?id=929 Props: Kaf Oseo

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
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_filter_kses');
29 add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
30 add_filter('pre_comment_content', 'balanceTags', 30);
31 add_filter('pre_comment_content', 'addslashes', 50);
32
33 add_filter('pre_comment_author_name', 'wp_filter_kses');
34 add_filter('pre_comment_author_email', 'wp_filter_kses');
35 add_filter('pre_comment_author_url', 'wp_filter_kses');
36
37 // Default filters for these functions
38 add_filter('comment_author', 'wptexturize');
39 add_filter('comment_author', 'convert_chars');
40 add_filter('comment_author', 'wp_specialchars');
41
42 add_filter('comment_email', 'antispambot');
43
44 add_filter('comment_url', 'clean_url');
45
46 add_filter('comment_text', 'convert_chars');
47 add_filter('comment_text', 'make_clickable');
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 // Places to balance tags on input
54 add_filter('content_save_pre', 'balanceTags', 50);
55 add_filter('excerpt_save_pre', 'balanceTags', 50);
56 add_filter('comment_save_pre', 'balanceTags', 50);
57
58 // Misc. title, content, and excerpt filters
59 add_filter('the_title', 'convert_chars');
60 add_filter('the_title', 'trim');
61
62 add_filter('the_content', 'convert_smilies');
63 add_filter('the_content', 'convert_chars');
64 add_filter('the_content', 'wpautop');
65
66 add_filter('the_excerpt', 'convert_smilies');
67 add_filter('the_excerpt', 'convert_chars');
68 add_filter('the_excerpt', 'wpautop');
69 add_filter('get_the_excerpt', 'wp_trim_excerpt');
70
71 add_filter('sanitize_title', 'sanitize_title_with_dashes');
72
73 // RSS filters
74 add_filter('the_title_rss', 'strip_tags');
75 add_filter('the_title_rss', 'ent2ncr', 8);
76 add_filter('the_content_rss', 'ent2ncr', 8);
77 add_filter('the_excerpt_rss', 'convert_chars');
78 add_filter('the_excerpt_rss', 'ent2ncr', 8);
79 add_filter('comment_author_rss', 'ent2ncr', 8);
80 add_filter('comment_text_rss', 'htmlspecialchars');
81 add_filter('comment_text_rss', 'ent2ncr', 8);
82 add_filter('bloginfo_rss', 'ent2ncr', 8);
83 add_filter('the_author', 'ent2ncr', 8);
84
85 // Actions
86 add_action('publish_post', 'generic_ping');
87
88 ?>
Note: See TracBrowser for help on using the browser.