Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:27:19+00:00 2026-06-11T08:27:19+00:00

I have already used this hook in the same way described below, What could

  • 0

I have already used this hook in the same way described below, What could be going wrong?

class my_plugin {

    function __construct()
    {
        parent::__construct();

        var_dump(__LINE__); // run 
        add_filter('login_redirect', array($this, 'login_redirect'));
    }

    function login_redirect()
    {
        var_dump(__LINE__); // not run
    }

}

EDIT 1

This hook run after successfully login processes. As I said I have used this hook in another plugins. The question is What could cause this malfunction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:27:21+00:00Added an answer on June 11, 2026 at 8:27 am

    Ok, got it.

    For the record:

    It is sure that could helps someone else. Indeed time ago I suffered a problem triggered by the same reason: is_admin() incorrect use:

    My starter code is:

    if (is_admin())
    {
        // block 1
        // 
        // run admin classes
        // including my_plugin class
        // that includes login_redirect hook // WRONG!
    }
    else
    {
        // block 2
        // 
        // run frontend classes
    }
    

    login_redirect hook does not run inside admin pages (is_admin() condition)

    Solution: move login_redirect hook to frontend block

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to configure boost already, but this time I have no idea what
sending mail along with embedded image using asp.net I have already used following but
I have already download and install this package to support HTML5 input type http://support.microsoft.com/kb/2468871
I have already surveyed SO for an answer, and could not find an appropriate
I have already used the Data -> Get Data From External Sources -> From
I have already used wininet to send some synchronous HTTP requests. Now, I want
I have used this question here on stackoverflow to create a random string without
I have a custom validator NoOtherUsed: to check if the email is already used
I have a LRESULT CALLBACK function in a header file(hook.h) that I both forward
How can i sort ArrayList in java without using comparator.? I have already used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.