Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Stanislav Khromov

    (@khromov)

    Hey DFranzwa,

    Not right now. You can use linkable="0" to disable creating a link but the hidden content will then display in plaintext.

    Really like the idea and will keep this open until it’s implemented.

    Thread Starter DFranzwa

    (@dfranzwa)

    Stanislav Khromov,

    Thanks or responding. I’ll be following development to see if and when this this is implemented.

    Very easy to do this yourself.
    Edit the plugin .php or create your own plugin and make these additions to the .php (additions contained in < strong > tags):

    * Obfuscation routine
         **/
        static function obfuscate_shortcode($args)
        {
            //Get values from shortcode and put them in local variables
            extract
            (
                shortcode_atts
                (
                    array
                    (
            	       'email' => false,
    		<strong>'phone' => false,</strong>
                       'linkable' => true, //0 if you want to store phones, names or other hidden information instead of emails
                       'link_title' => "",
                       'use_htmlentities' => true,
                       'use_noscript_fallback' => true,
                       'noscript_message' => __("Please enable JavaScript to see this field.", "email-obfuscate-shortcode"),
    				   'tag_title' => ''
                    ),
                    $args
                )
    //Init return variable
                $ret = $email;
                
                //Encode as htmlentities
                if($use_htmlentities)
                    $ret = EOS::html_entities_all($ret);
    
    		<strong>//wrap in tel: link
    if($phone)
    			   $ret = '<a href="tel:'.$ret.'"'. ($tag_title != '' ? (' title="'. $tag_title .'"') : '') .'>'. ($link_title=='' ? $email : $link_title) .'</a>';</strong>
                
                
                //Wrap in mailto: link
                if($linkable)
    			   $ret = '<a href="mailto:'.$ret.'"'. ($tag_title != '' ? (' title="'. $tag_title .'"') : '') .'>'. ($link_title=='' ? $email : $link_title) .'</a>';
                

    Note: you can delete some of the code in the second addition, but it doesn’t hurt to leave it there. Perhaps the plugin author can provide a better code snippet?

    Then you add the following shortcode to your post:

    [email-obfuscate email=”tel:+01123456″ linkable=”0″ phone=”1″ link_title=”0123456″ ] Obviously replace the +01123456 with the right number ??

    • This reply was modified 8 years, 1 month ago by tombsc.
    Thread Starter DFranzwa

    (@dfranzwa)

    Thanks, @tombsc
    I’ll give it a shot

    Just spotted a minor error in the shortcode, this is better:

    [email-obfuscate email=”+01123456″ linkable=”0″ phone=”1″ link_title=”0123456″ ] Obviously replace the +01123456 with the right number ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Possible to maintain a click-to-call link?’ is closed to new replies.