• I have a snippet of code that I’d like to use to generate two different outcomes. If the user is on page 1, I want the function to point them to the delivery page. If they are on the delivery page, I want the function to point them to a thank you page. Here is the code that points them to page 2:

    function app_redirect( $script ){
        return str_replace("window.location.href=app_location()", "window.location.href='https://islandfreshlaundry.com/dev/delivery/'", $script);
    }
    add_filter( 'app_footer_scripts', 'app_redirect' );

    How can I modify that so that it continues to function as is on page 1, but has a different redirect from the delivery page?

    Hope that makes sense…

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter owlsheadbiz

    (@owlsheadbiz)

    I’m realizing this is not what I need to do. The function that I’m adding is replacing a string somewhere in a script, which I have searched for long enough that I can’t see straight anymore.

    What I need is to modify the script so that it redirects to one page in one instance and another page in another instance.

    Can anyone tell me based on the code above what script I should be looking for? Or is that changing an instance in the database that is dynamic and there’s no way I can do what I want to do?

    Thread Starter owlsheadbiz

    (@owlsheadbiz)

    I think the guys at wpmudev are handling this. I’ll report back if the issue is unresolved past this evening.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using if statement in Functions.php file’ is closed to new replies.