1. How find template name?
<?php

$template = basename( get_page_template() );

if( $template == ‘template-add_category.php’ ) { ?>

 

2. wp_check_password( $edt_opass, $user->data->user_pass, $user->ID)

 

3. wp_set_password($newpass, $user->ID);

 

4.

$template = basename( get_page_template() );

get_page_template() returns the path of the page template used to render the page.

 

5. This function sets the cookie.wp_clear_auth_cookie() This function will delete the cookie from the client browser. This happens when the user clicks on the Logout link in the Administration interface.

wp_set_auth_cookie( $user_id, $remember, $secure )

 

6. This function also utilizes the cookies. Checks whether the cookie is present on the client browser. If it is not, the user is sent to the wp-login.php login screen. After logging in, the user is sent back to the page he or she attempted to access.

auth_redirect()

 

7.  By default, the “Remember Me” checkbox makes you get remembered for 14 days. This is filterable though.

This code will change that value:

add_filter(
'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
function keep_me_logged_in_for_1_year( $expirein ) {
return 31556926; // 1 year in seconds
}

Leave a Reply