Untested, but the following should only change the expiration time for admins who select ‘remember me’.
function wpse108399_change_cookie_logout( $expiration, $user_id, $remember ){
if( $remember && user_can( $user_id, 'manage_options' ) ){
$expiration = 60;// yes, I know this is 1 minute
}
return $expiration;
}
add_filter( 'auth_cookie_expiration','wpse108399_change_cookie_logout', 10, 3 );
Related Posts:
- Setting cookies in WordPress
- wp_validate_logged_in_cookie
- Current path on page in functions.php
- How to run a function in every page, every device
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- how to increase connection time
- Setting a cookie in functions.php and it gets deleted when working on an other function
- Language switcher for subdomains
- Setcookie not setting cookies anywhere except admin
- What’s the difference between WordPress random_int() and PHP built-in function random_int()?
- Is it ok to use a function to output the text domain name in a wordpress theme
- Issue with wp_get_attachment_image() and SVG file type
- deregister scripts on certain page
- Show Video in Excerpt
- How Can I Access a PHP Variable in Another PHP Function
- How to fix a theme with page.php Default Template that accidentally deleted?
- Override parent theme function that is not hooked or in the functions.php file
- Theme Demo in live Site
- function to include is_home, is_archive, is_category, is_author etc in one function?
- How to remove canonical url in wordpress? add_filter( ‘wpseo_canonical’, ‘__return_false’ ); not Working for me
- Change a sidebar name?
- Removing title from page
- get_the_excerpt() not returning anything when post has no excerpt
- Why isn’t is_page_template() adding a body class?
- Query children and parent title
- How to make unique add_filter to the_content of specific page template files – so each template gets its own addition
- Creating loop within functions.php
- Limit filter upgrader_post_install to a single plugin
- How to test for Super Admin
- creating shortcode to pull json array
- Still relevant method of embedding images in WP Theme in 2018
- Pass Shortcode Attribute to footer Script
- post to subcategory and parent in wp_insert_post
- Replace menu links with # and add name to its li
- Variable if post is sticky in functions.php
- Change template on the fly based on post parent selection
- Create a new query in function.php to filter blog posts
- Use third party Library in wordpress
- Remove the product category module block from the Woocommerce product page
- Setting youtube size in functions.php
- Creating new blog on multisite programatically without hacks?
- Allowing users to view private posts (pending approval)
- How to get correct URLs in network wide menu (Multisite)?
- Remove category from url
- ‘Attempt to modify property of non-object’ warning
- Conditional functions.php on page template
- Optimizing a WordPress site
- different style sheet for just one page template
- Problem with comments_number()
- Functions when woocommerce isn’t installed
- How to target post and pages and not all post types in admin?
- hide shortcode using hooks
- Dequeue script to prevent javascript event conflict on wordpress child theme
- Adding code using functions.php in child theme
- Passing global variable from header.php to functions.php
- Page get parameter doesn’t work with is_single() function
- How is $current_page passed in woocommerce_account_orders function?
- Upgraded server now class My_Walker_Nav_Menu extends Walker_Nav_Menu not working
- Filter to wp_list_authors
- Contact Form 7 If Condition
- How to include any template using Shortcode fuction?
- display a div on ervery site but not frontpage?
- How can I change the size of the text in Word Press
- Using depth=n in wp_list_pages
- shorthand syntax for custom fields
- How do I pull avatar from post using BuddyPress? [closed]
- Replace header image on all other pages but home – URL issue
- Child theme functions.php
- How to echo Widget Title in Custom Frontend-Template Box
- Redirect to post after publish or update a published post
- Get users with different roles and call function on each of them (user_meta)
- Getting images from media library and get_the_date() not working
- WordPress show bad the php hour and date
- Show errormessages on wrong username/password on custom loginform?
- Using add_image_size in functions.php to get original uploaded file
- show all the posts thumbnails
- the_excerpt function not showing image
- How do I change where “You must be logged in to comment” directs users?
- Login cookies blocked after customizing hashing method
- Class parameter in get_avatar args doesn’t get added to output
- Remove text after a dot and a colon in Woocommerce product title
- Enable CORS Request for hostname using IP address
- locking content with overlay/pop up ads
- How to use `foreach()` in ajax call
- Change default color scheme in twentyfifteen child theme?
- Restrict access if logged out except for homepage
- Add meta data in head from theme
- DISABLE wordpress upgrade page
- How to echo the translated custom field?
- How to list out all values from the get_body_class array
- Moving CDN jQuery to footer does not work?
- Function not recognizing page id?
- Register a widget area when a theme option has been saved?
- Blank child theme – functions.php problem
- Conditionally write open graph meta property in header
- Pull random comment from specific post, display on homepage with shortcode
- Give a function a unique ID
- Hiding Google Analytics code based on theme options
- How do I make my child theme’s CSS update when I save it?
- WooCommerce, change “Add to Cart” to “Link to Product”, only for specific categories