html_encode.php
29 lines
| 1 | <?php |
| 2 | if ( ! function_exists( 'lim_email_html_encode' ) ): |
| 3 | |
| 4 | // Info (optional) |
| 5 | $lim_email_html_encode = array( |
| 6 | 'name' => 'Html Encode', |
| 7 | 'description' => 'Email encode method using antispambot() built-in WordPress (<a href="http://codex.wordpress.org/Function_Reference/antispambot" target="_blank">more info</a>).', |
| 8 | ); |
| 9 | |
| 10 | /** |
| 11 | * lim_email_html_encode() |
| 12 | * Default email encode method converting email to html entities |
| 13 | * |
| 14 | * @package Lim_Email_Encoder |
| 15 | * @param string $email the email to encode |
| 16 | * @param string $display the display showing on the page |
| 17 | * @return string |
| 18 | */ |
| 19 | function lim_email_html_encode( $email, $display ) { |
| 20 | $email = Lim_Email_Encoder::get_htmlent( $email ); |
| 21 | $display = Lim_Email_Encoder::get_htmlent( $display ); |
| 22 | |
| 23 | // return encode mailto link |
| 24 | return '<a href="mailto:' . $email . '">' . $display . '</a>'; |
| 25 | } |
| 26 | |
| 27 | endif; |
| 28 | |
| 29 | ?> |