@@ 3907-3922 (lines=16) @@ | ||
3904 | * @param string $text |
|
3905 | * @return string |
|
3906 | */ |
|
3907 | function esc_html( $text ) { |
|
3908 | $safe_text = wp_check_invalid_utf8( $text ); |
|
3909 | $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES ); |
|
3910 | /** |
|
3911 | * Filters a string cleaned and escaped for output in HTML. |
|
3912 | * |
|
3913 | * Text passed to esc_html() is stripped of invalid or special characters |
|
3914 | * before output. |
|
3915 | * |
|
3916 | * @since 2.8.0 |
|
3917 | * |
|
3918 | * @param string $safe_text The text after it has been escaped. |
|
3919 | * @param string $text The text prior to being escaped. |
|
3920 | */ |
|
3921 | return apply_filters( 'esc_html', $safe_text, $text ); |
|
3922 | } |
|
3923 | ||
3924 | /** |
|
3925 | * Escaping for HTML attributes. |
|
@@ 3932-3947 (lines=16) @@ | ||
3929 | * @param string $text |
|
3930 | * @return string |
|
3931 | */ |
|
3932 | function esc_attr( $text ) { |
|
3933 | $safe_text = wp_check_invalid_utf8( $text ); |
|
3934 | $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES ); |
|
3935 | /** |
|
3936 | * Filters a string cleaned and escaped for output in an HTML attribute. |
|
3937 | * |
|
3938 | * Text passed to esc_attr() is stripped of invalid or special characters |
|
3939 | * before output. |
|
3940 | * |
|
3941 | * @since 2.0.6 |
|
3942 | * |
|
3943 | * @param string $safe_text The text after it has been escaped. |
|
3944 | * @param string $text The text prior to being escaped. |
|
3945 | */ |
|
3946 | return apply_filters( 'attribute_escape', $safe_text, $text ); |
|
3947 | } |
|
3948 | ||
3949 | /** |
|
3950 | * Escaping for textarea values. |