Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Branding Addicted

    (@brandingaddicted)

    I write here what i tried after reading this: https://wordpress.org/support/topic/433/

    1) I opened file contact-form-7-dynamic-text-extension/contact-form-7-dynamic-text-extension.php and seaerched for function cf7_url()

    2) I deleted the original function

    3) I added this function:

    function cf7_url(){
    	$pageURL = 'http';
     	if( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on"){ $pageURL .= "s"; }
     	$pageURL .= "://";
     	$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
     	return $pageURL;
    }
    add_shortcode('CF7_seb_URL', 'cf7_seb_url');

    4) I added this shortcode to my form
    [dynamictext dynamictext-999 “CF7_seb_URL”]

    But nothing happened, it didn’t work.

    So I came back to the original function, removing the code for adding the server’s port.

    Now the function is:

    function cf7_url(){
    	$pageURL = 'http';
     	if( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on"){ $pageURL .= "s"; }
     	$pageURL .= "://";
      	$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
     	return $pageURL;
    }
    add_shortcode('CF7_URL', 'cf7_url');

    It works, but at first plugin’s update, I will lose it.

    So..how to make a permanent hook for this?
    And above all..what is the feature to adding the server port to the url?

    Thanks

    It’s not necessary to edit anything in any of the plugins PHP files to get the URL that resulted in the contact form.

    You just add “[dynamichidden dynamictext PageURL “CF7_URL”] to the form.
    And you can use the standard [_url] tag in the mail area.

    Thread Starter Branding Addicted

    (@brandingaddicted)

    Hi Usat,
    if you use “CF7_URL”, it adds :443 in the url.
    Not for you?

    Plugin Author sevenspark

    (@sevenspark)

    I believe you’re getting that because you’re running over HTTPS. I’m not sure if that’s the same for every site or something specific to your configuration.

    I’ll look at excluding the HTTPS port in the next version or adding an option to disable the port number.

    Note that you don’t need to delete anything in the plugin, or edit anything at all. Just add your custom shortcode (make sure your function callback is a custom name as well), and add it wherever you store custom code on your site (e.g. a child theme’s functions.php). Then use that shortcode. There’s no need to delete the existing shortcode to use a custom one.

    Hope that helps!

    Hi sevenspark,

    I have the same problem, waiting for the updates. 🙂

    Thank you,
    Kind regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CF7_URL error: adding a :443 in url’ is closed to new replies.