WordPress.org

Forums

Contact Form 7 Dynamic Text Extension
[resolved] Fatal Error in CF7 with Dynamic Value (5 posts)

  1. sanketzalak
    Member
    Posted 2 years ago #

    Hi,

    I have Custom Function into CF7 Function File, as Follow

    /* Generate UserInfo */
    function genUsrInfo()
    {
    	global $current_user;
    	get_currentuserinfo();
    	$string = $current_user->user_login;
    	return $string;
    }
    add_shortcode('username', 'genUsrInfo');

    Now When I try to insert / use above short code "username" with Dynamic Unedited Field its shows Error

    [dynamictext dynamictext-459 "'username'"]

    Error Message :
    Fatal error: Call to undefined method WPCF7_ContactForm::get_current() in C:\wamp\www\web\wp-content\plugins\contact-form-7-dynamic-text-extension\contact-form-7-dynamic-text-extension.php on line 59

    https://wordpress.org/plugins/contact-form-7-dynamic-text-extension/

  2. sevenspark
    Member
    Plugin Author

    Posted 2 years ago #

    Are you sure you're using the latest version of Contact Form 7?

  3. sanketzalak
    Member
    Posted 2 years ago #

    Yup, I'm sure

  4. sevenspark
    Member
    Plugin Author

    Posted 2 years ago #

    By the way you shouldn't have single quotes around your shortcode

    [dynamictext dynamictext-459 "username"]

    not

    [dynamictext dynamictext-459 "'username'"]

    But you should also probably prefix your shortcode.

  5. phpbits
    Member
    Posted 1 year ago #

    Hi,

    I'm getting the same error. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7 Dynamic Text Extension
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic