.htaccess
11 years ago
class-eeb-admin.php
11 years ago
class-eeb-site.php
11 years ago
deprecated.php
11 years ago
template-functions.php
11 years ago
template-functions.php
74 lines
| 1 | <?php defined('ABSPATH') OR die('No direct access.'); |
| 2 | |
| 3 | /** |
| 4 | * Template Functions |
| 5 | * |
| 6 | * @package Email_Encoder_Bundle |
| 7 | * @category WordPress Plugins |
| 8 | */ |
| 9 | if (!is_admin()): |
| 10 | |
| 11 | /** |
| 12 | * Template function for encoding email |
| 13 | * @global Eeb_Site $Eeb_Site |
| 14 | * @param string $email |
| 15 | * @param string $display if non given will be same as email |
| 16 | * @param string $extra_attrs Optional |
| 17 | * @param string $method Optional, else the default setted method will; be used |
| 18 | * @return string |
| 19 | */ |
| 20 | if (!function_exists('eeb_email')): |
| 21 | function eeb_email($email, $display = null, $extra_attrs = '', $method = null) { |
| 22 | global $Eeb_Site; |
| 23 | return $Eeb_Site->encode_email($email, $display, $extra_attrs, $method); |
| 24 | } |
| 25 | endif; |
| 26 | |
| 27 | |
| 28 | /** |
| 29 | * Template function for encoding content |
| 30 | * @global Eeb_Site $Eeb_Site |
| 31 | * @param string $content |
| 32 | * @param string $method Optional, default null |
| 33 | * @return string |
| 34 | */ |
| 35 | if (!function_exists('eeb_content')): |
| 36 | function eeb_content($content, $method = null) { |
| 37 | global $Eeb_Site; |
| 38 | return $Eeb_Site->encode_content($content, $method); |
| 39 | } |
| 40 | endif; |
| 41 | |
| 42 | /** |
| 43 | * Template function for encoding emails in the given content |
| 44 | * @global Eeb_Site $Eeb_Site |
| 45 | * @param string $content |
| 46 | * @param boolean $enc_tags Optional, default true |
| 47 | * @param boolean $enc_mailtos Optional, default true |
| 48 | * @param boolean $enc_plain_emails Optional, default true |
| 49 | * @param boolean $enc_input_fields Optional, default true |
| 50 | * @return string |
| 51 | */ |
| 52 | if (!function_exists('eeb_email_filter')): |
| 53 | function eeb_email_filter($content, $enc_tags = true, $enc_mailtos = true, $enc_plain_emails = true, $enc_input_fields = true) { |
| 54 | global $Eeb_Site; |
| 55 | return $Eeb_Site->encode_email_filter($content, $enc_tags, $enc_mailtos, $enc_plain_emails, $enc_input_fields); |
| 56 | } |
| 57 | endif; |
| 58 | |
| 59 | /** |
| 60 | * Template function for getting HTML of the encoder form (to put it on the site) |
| 61 | * @global Eeb_Site $Eeb_Site |
| 62 | * @return string |
| 63 | */ |
| 64 | if (!function_exists('eeb_form')): |
| 65 | function eeb_form() { |
| 66 | global $Eeb_Site; |
| 67 | return $Eeb_Site->get_encoder_form(); |
| 68 | } |
| 69 | endif; |
| 70 | |
| 71 | endif; |
| 72 | |
| 73 | /* ommit PHP closing tag, to prevent unwanted whitespace at the end of the parts generated by the included files */ |
| 74 |