shortcodes.php
40 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | /** @var array< string, array< string > > $allowed_attr_html */ |
| 4 | |
| 5 | ?> |
| 6 | <h3><?php echo esc_html__( 'Shortcodes', 'email-encoder-bundle' ); ?></h3> |
| 7 | |
| 8 | <p><?php echo esc_html__( 'You can protect those addresses using the following shortcode. Everything you add within these both tags, will be checked for emails automatically.', 'email-encoder-bundle' ); ?></p> |
| 9 | |
| 10 | <p><code>[eeb_protect_emails protect_using="with_javascript"]…[/eeb_protect_emails]</code> |
| 11 | </p> |
| 12 | <p><?php echo esc_html__( 'Create a protected mailto link:', 'email-encoder-bundle' ); ?></p> |
| 13 | <p><code>[eeb_mailto email="info@myemail.com" extra_attrs="target='_blank'" method="rot13" display="Custom Text"]</code></p> |
| 14 | <p><?php echo esc_html__( 'For security reasons, we only allow specific HTML tags within the display arguments. You will find a full list below.', 'email-encoder-bundle' ); ?></p> |
| 15 | <p><?php echo esc_html__( 'You can also protect phone numbers and any kind of text by using the following shortcode:', 'email-encoder-bundle' ); ?></p> |
| 16 | <p><code>[eeb_protect_content protection_text="I am a noscript text" method="rot13" do_shortcode="yes"]My Email[/eeb_protect_content]</code></p> |
| 17 | <p><?php echo esc_html__( 'Display the encoder form', 'email-encoder-bundle' ); ?></p> |
| 18 | <p><code>[eeb_form]</code></p> |
| 19 | |
| 20 | <p><strong><?php echo esc_html__( 'Allowed HTML attributes + arguments', 'email-encoder-bundle' ); ?></strong> |
| 21 | |
| 22 | <ul> |
| 23 | |
| 24 | <?php |
| 25 | foreach ( $allowed_attr_html as $tag => $attributes ) { |
| 26 | echo '<li><strong>' . esc_html( '<' . $tag . '>' ) . '</strong>: '; |
| 27 | |
| 28 | if (!empty($attributes)) { |
| 29 | echo esc_html( trim( implode( ', ', array_keys( $attributes ) ), ', ' ) ); |
| 30 | } else { |
| 31 | echo 'n/a'; |
| 32 | } |
| 33 | |
| 34 | echo '</li>'; |
| 35 | } |
| 36 | ?> |
| 37 | </ul> |
| 38 | |
| 39 | </p> |
| 40 |