• Hi,

    I have a couple of code contributions in case they are useful. (PS: I already sent an email to the plugin author but am re-posting here in case it’s useful.)

    One is a minor bugfix when loading wp externally: I needed to add
    global $wpcf7_shortcode_manager;
    in file includes/shortcodes.php, just before the line
    $wpcf7_shortcode_manager = new WPCF7_ShortcodeManager();

    Additionally, I found it useful for the e-mail to tell whether the user was logged in. For this I added the following to special-mail-tags.php:

    elseif ( 'user_info' == $name ) {
              if ( is_user_logged_in() ) {
                $output = 'logged in';
                $user = wp_get_current_user();
                $output = '#' . $user->ID . ' ' . $user->user_login
                  . " <" . $user->user_firstname . ' ' . $user->user_lastname . ">"
                  . " " . $user->display_name
                  . " " . $user->user_email;
              }
              else $output = 'User not logged in.';
            }

    Thanks for the fantastic plugin!
    – Dave

    https://www.ads-software.com/extend/plugins/contact-form-7/

  • The topic ‘[Plugin: Contact Form 7] Code suggestions’ is closed to new replies.