Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thank you for this referer & info
    But which file edit for add this code ?

    function hiddenreferer_shortcode($tag) {
    
        if ( ! is_array( $tag ) )
            return '';
    
        $options = (array) $tag['options'];
        foreach ( $options as $option ) {
            if ( preg_match( '%^name:([-0-9a-zA-Z_]+)$%', $option, $matches ) ) {
                $name_att = $matches[1];
            }
        }
    
         $pageURL = 'http';
         if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
         $pageURL .= "://";
         if ($_SERVER["SERVER_PORT"] != "80") {
              $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
         } else {
              $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
         }
    
         $value_att = $pageURL;
         $html = '<input type="hidden" name="' . $name_att . '" value="'.$value_att.'" />';
         return $html;
    }
    wpcf7_add_shortcode('hiddenreferer', 'hiddenreferer_shortcode', true);

Viewing 1 replies (of 1 total)