Undefined index: action with code-snippets to change register page

I see this error

Notice: Undefined index: action in /home/olexywro/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(352) : eval()’d code on line 6

in my login page with this code snippets:

// Redirect Registration Page
function my_registration_page_redirect()
{
global $pagenow;

if ( ( strtolower($pagenow) == ‘wp-login.php’) && ( strtolower( $_GET[‘action’]) == ‘register’ ) ) {
wp_redirect( home_url(‘/zarejestruj-sie/’));
}
}
add_filter( ‘init’, ‘my_registration_page_redirect’ );

Somone could me tell me why?

6th line of this code:

if ( ( strtolower($pagenow) == ‘wp-login.php’) && ( strtolower( $_GET[‘action’]) == ‘register’ ) ) {

Read more here:: Undefined index: action with code-snippets to change register page

Leave a Reply

Your email address will not be published. Required fields are marked *