How to remove 'wordpress...' text from page titles in tabs

I am working on a site and sometimes I run into an error when logging out and on the site tab it says 'Wordpress Failure Notice'. I am trying to remove all instances of wordpress so users dont know Im using it, but I can not figure out how to remove the text from the tab. I dont have no code to try and show because Im not even sure where to start. The text shows up on the wp-login.php …
Category: Web

Force logout ALL users at a certain time

I'm wondering if it's possible to logout all users 2 times a day using the function wp_logout() ? I see loads of plugins who can logout idled users but we want to log out every single users twice a day at 2PM and 10PM Hope someone can help me with this.
Category: Web

add class to element if user is not logged in

Please help . I need to add class to this button if user is not logged in <?php echo apply_filters( 'my_order_html', '<button type="submit" class="ADD-CLASS-HERE cfw-primary-btn cfw-next-tab validate" name="my_list_html" id="place_order" formnovalidate="formnovalidate" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '"><span class="cfw-button-text">' . esc_html( $order_button_text ) . '</span></button>' ); // @codingStandardsIgnoreLine ?>
Category: Web

how to refresh page after user logout with 'wp_logout_url'?

I have written a plugin for my own site where I have an issue like "after user login to the site if he logout then again if he clicks on browser back button then the previous page showing again instead of login page". Iam trying the below code but it doesn't work. <script> window.onhashchange = function() { <?php if( ! is_user_logged_in()) { $this->tewa_login(); } ?> } <script> My logout code is below: if ( is_user_logged_in() ) { $data .= '<li><a …
Category: Web

Update user meta on logout

I have seen some answers, but the questions are quite a number of years old, and the after trying their responses I've not been able to get it to work. I need to update user meta data during the logout process, specifically the automatic logout process that occurs when the user is idle for too long. I am using the code below but the user meta is not being updated. add_action('clear_auth_cookie', 't_o_update'); function t_o_update() { $user = wp_get_current_user(); update_user_meta($user->ID, 'online_status', …
Category: Web

Logout redirect to home page

I'm using custom menu for login/logout here below is my code: <li> <?php if (is_user_logged_in()) { $user = wp_get_current_user(); echo 'Welcome <strong><a href="http://kolkataonwheelsmagazine.com/wp-admin/index.php" >'.$user->user_firstname.'</a></strong> | <a href="http://kolkataonwheelsmagazine.com/wp-login.php?action=logout"">Logout</a>'; } else { ?> <strong><?php wp_loginout(); ?></strong> or <a href="<?php bloginfo('url') ?>/wp-login.php?action=register"> <strong>Register</strong></a> <?php }?> </li> but problem is : redirect to login page not current page... I want it should go to home page after logout. Please help me...
Category: Web

Multiple use wp_logout_url() on page cause 'header already sent' error after submit form

I am using two wp_logout_url() echoes on page. The first one is used in header.php custom theme file, second one is used in another page template file (page-[customslug].php). On that page i have a form to edit user profile data. Sending this form cause on result page "headers already sent" error. To avoid this problem i must remove one from those two lines where i use <?php echo wp_logout_url(); ?>. <?php get_header(); <--- first wp_logout_url(); /* page-[custom-slug].php content */ <--- …
Category: Web

logging out with/without confirmation - single site, multisite

I have two wordpress installations: a single one and a multisite with subdirectories. On both my users can logout with the url: [URL to]/wp-login.php?action=logout&redirect_to=%2Fmydir%2F&_wpnonce=[some_code] This works on the single site without confirmation, but on the site within the multisite it doesn't. Here the user needs to confirm the logout. How can I bypass the confirmation? Thank you.
Category: Web

After logout browser's back button into twenty sixteen theme profile

I have tried numerous ways to prevent the browser's back button from allowing someone from using it to go back into a visitors logged out profile. The codes I used were supposed to prevent the browser from caching data from the last page visited after logout. They don't work. Wordpress logs the visitor out once they click the logged out button, yes this portion wors. Unfortunately, you can see the last page visited by the person who was logged on. …
Category: Web

wp_logout problem

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired function render_logout() { if ( is_user_logged_in() ){ wp_logout(); } else { echo "You are not logged-in"; } } the logout works but generates a lot of warnigns of Warning: Cannot modify header information - headers already sent by (output started at /home/........./formatting.php:5081) in /home/s..../wp-includes/pluggable.php on line 915 and i cannot find what is at fault but redirect after logout does …
Category: Web

Logout without confirmation and SAME window on mobile

I using this code to logout. It works except on mobile it opens a new window. How can I logout with confirmation and redirect to to the same window? add_action('check_admin_referer', 'logout_without_confirm', 10, 2); function logout_without_confirm($action, $result) { /** * Allow logout without confirmation */ if ($action == "log-out" && !isset($_GET['_wpnonce'])) { $redirect_to = isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : 'https://www.example.com'; $location = str_replace('&', '&', wp_logout_url($redirect_to)); header("Location: $location"); die; } }
Category: Web

wp_logout hook never triggered

Long story short. In wp-config.php: define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', false); define('WP_DEBUG_LOG', true); In the main file of my plugin, in the constructor: public function __construct(){ error_log("this is properly logged"); add_action( 'wp_logout', array($this, 'logout') ); } Then the logout method: public function logout(){ error_log("never logged"); } The logout method is never executed. Why? The whole story I allow user to signin/signup using OpenID Connect Generic plugin. Locally everything works as expected. On remote server I encountered problem only with logout. If I …
Category: Web

Check if user had autologin & if so, logout

I'm trying to create a function which autologins users, but upon visiting certain pages also performs an autologout if the initial login was obtained via autologin. I've written the following code but I guess my boolean check for the autologin boolean does not work. /* AUTO LOGIN / LOGOUT */ function autologinout() { global $wp; // Autologin if( isset($_GET['username']) ) { $user = get_user_by('login', $_GET['username']); // Redirect URL // if ( !is_wp_error( $user ) ) { if ( in_array( 'customer', …
Category: Web

Change auth_cookie_expiration for specific roles and specific login times

In my db i have a login counter that keeps a number value as a record (1,2,3,4,5...)every time a user from a specific role logins. I am trying to change the auth_cookie_expiration to 1 day for specific roles and for the first 2 logins. So i have created this: // Force logout specific users for the first 2 logins after one day function change_cookie_logout($expiration, $user_id, $remember){ $user = wp_get_current_user(); $login_amount = get_user_meta( $user_id, 'login_amount', true ); $specific_roles = array('contributor', 'producer' …
Category: Web

How to restrict browser back button after logout?

I'm facing a issue from couple of days, after logout user can view the login user history details using browser back button, so how could I resolve this issue. Could you suggest me to solve this issue Thanks in advance
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.