-
Notifications
You must be signed in to change notification settings - Fork 0
/
bp-links-filters.php
52 lines (44 loc) · 2.46 KB
/
bp-links-filters.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/* Apply WordPress defined filters */
add_filter( 'bp_get_link_url', 'stripslashes' );
add_filter( 'bp_get_link_name', 'stripslashes' );
add_filter( 'bp_get_link_description', 'stripslashes' );
add_filter( 'bp_get_link_description_excerpt', 'stripslashes' );
add_filter( 'bp_links_add_meta_description_single_item', 'stripslashes' );
add_filter( 'bp_get_link_name', 'wptexturize' );
add_filter( 'bp_get_link_description', 'wptexturize' );
add_filter( 'bp_get_link_description_excerpt', 'wptexturize' );
add_filter( 'bp_links_add_meta_description_single_item', 'wptexturize' );
add_filter( 'bp_get_link_name', 'convert_chars' );
add_filter( 'bp_get_link_description', 'convert_chars' );
add_filter( 'bp_get_link_description_excerpt', 'convert_chars' );
add_filter( 'bp_links_add_meta_description_single_item', 'convert_chars' );
// not sure how this works, but we don't want any html tags anyways
//add_filter( 'bp_get_link_name', 'wp_filter_kses', 1 );
//add_filter( 'bp_get_link_description', 'wp_filter_kses', 1 );
//add_filter( 'bp_get_link_description_excerpt', 'wp_filter_kses', 1 );
//add_filter( 'bp_links_link_name_before_save', 'wp_filter_kses', 1 );
//add_filter( 'bp_links_link_description_before_save', 'wp_filter_kses', 1 );
//add_filter( 'bp_links_add_meta_description_single_item', 'wp_filter_kses', 1 );
// just escape any html to be safe
// FYI if you remove this filters the feed is going to get hosed
add_filter( 'bp_get_link_url', 'esc_url' );
add_filter( 'bp_get_link_name', 'esc_html' );
add_filter( 'bp_get_link_description', 'esc_html' );
add_filter( 'bp_get_link_description_excerpt', 'esc_html' );
add_filter( 'bp_links_add_meta_description_single_item', 'esc_html' );
// forms - strip
add_filter( 'bp_get_link_details_form_category_id', 'stripslashes' );
add_filter( 'bp_get_link_details_form_url', 'stripslashes' );
add_filter( 'bp_get_link_details_form_name', 'stripslashes' );
add_filter( 'bp_get_link_details_form_description', 'stripslashes' );
add_filter( 'bp_get_link_avatar_form_embed_html', 'stripslashes' );
// forms - escape
add_filter( 'bp_get_link_details_form_category_id', 'esc_attr' );
add_filter( 'bp_get_link_details_form_url', 'esc_attr' );
add_filter( 'bp_get_link_details_form_name', 'esc_attr' );
add_filter( 'bp_get_link_details_form_description', 'esc_html' );
add_filter( 'bp_get_link_avatar_form_embed_html', 'esc_html' );
add_filter( 'bp_get_link_description', 'convert_smilies' );
add_filter( 'bp_get_link_description_excerpt', 'convert_smilies' );
?>