• Hi there.

    I have tried to create a filter in my customizations plugin, but it doesn’t seem to take effect:

    add_filter( ‘rtl_override_redirect’, function() {
    return (strpos($_SERVER[REQUEST_URI], “export_events”) > 0);
    });

    If I hardcode the redirect plugin with this conditional before the actual filter chain, then it works:

    if (!strpos($_SERVER[REQUEST_URI], “export_events”) > 0) {
    if ( true !== $override ) {
    is_user_logged_in() || auth_redirect();
    }
    } }

    Is there some order or similar that is not correct then I add this to my general customization plugin rather than somwhere else?

    This is with version 1.70
    No matter if I said ‘is_front_page’, is_page(‘calendar’) or similar, if always sent me to the login page until I made the wrapper directly in the plugin as above ..?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daan Kortenbach

    (@daankortenbach)

    The filter is expecting a boolean.

    Thread Starter martinm76

    (@martinm76)

    I would have expected that the above expression evaluated to TRUE? (Well negated true, so actually FALSE, to be accurate), in my hardcoded statement)
    Should I in stead have ‘return TRUE’ and ‘return FALSE’ in my function, then?

    ‘is_front_page’ had no effect either, but I am unsure if the call of the plugin function invalidates it. Do you know?

    I’ll give it a shot with explicit TRUE and FALSE.

    • This reply was modified 6 years, 4 months ago by martinm76.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trouble getting add_filter to work properly with time.ly calendar export.’ is closed to new replies.