Error when setting up ref program

front page Forums Community Error when setting up ref program

This topic contains 3 replies, has 2 voices, and was last updated by Avatar WPExperts 6 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #4834

    I get the error of Fatal error: Call to undefined function dd_action() in /home/fitbobcat/public_html/wp-content/themes/anarcho-notepad/functions.php on line 517 when i try setting up the ref program. This has happned twice to me before. Please help me fix it. I lost the working code when i updated my theme. This time i will make suire to backup my custom code. THanks

    // THIS IS INCORRECT! There is no such thing as dd_action
    dd_action( 'user_register', 'check_for_referral_at_signup' );
    function check_for_referral_at_signup( $user_id )
    	// Check for cookie
    	if ( isset( $_COOKIE['signup_ref'] ) ) {
    		// Get the referrers ID
    		$ref_user_id = mycred_get_userid_from_ref( $_COOKIE['signup_ref'] );
    		// Make sure ref_id is valid, if not delete the cookie to avoid further checks
    		if ( $ref_user_id === false ) {
    			setcookie( 'signup_ref', $_COOKIE['signup_ref'], time()-3600 );
    		// Load myCRED
    		$mycred = mycred_get_settings();
    		// Make sure this is unique
    		if ( !$mycred->has_entry( 'signup_referral', $user_id, $ref_user_id ) ) {
    				'%plural% for signup referral of ',
    				array( 'ref_type' => 'user' )
    		// Remove Cookie by setting the expiration date in the past
    		setcookie( 'signup_ref', $ref_id, time()-3600 );


    That error message is self explenetry. You are using a function that does not exists! There is no function called dd_action it supposed to be add_action. I think you missed an “a” there.

    Go though your code and make sure you are using the correct functions.

    EDIT: I edited your code to show where the issue is.


    So what is it sopose to be there?


    You missed the first character when you copied and pasted the code from the tutorial.

    It supposed to be “add_action” and not “dd_action”.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.