• Resolved isdoo

    (@isdoo)


    Can this cope with functions?

    function my_allowed_redirect_hosts( $hosts ) {
    $my_hosts = array(
    ‘my.domain.com’,
    );
    return array_merge( $hosts, $my_hosts );
    };
    add_filter( ‘allowed_redirect_hosts’, ‘my_allowed_redirect_hosts’ );

    When added to functions.php it works fine.

    But not to this software.

    Not sure what I am doing wrong – maybe it is the various options – I am running as php anywhere for example.

Viewing 1 replies (of 1 total)
  • Plugin Author Mircea Sandu

    (@gripgrip)

    Hi @isdoo,

    Yes, WPCode can handle that type of code without issues and running it as code type PHP set to the auto-insert location “Run Everywhere” should have a similar effect to adding it to functions.php.

    Is it possible to share more details regarding what redirect you are trying to whitelist your domain for? The only scenario that I can think of where this might not work is if the redirect is supposed to happen before the “plugins_loaded” action that is used to execute the snippets.

Viewing 1 replies (of 1 total)

The topic ‘Adding a function?’ is closed to new replies.