White Labeling Snippets

// Replace Howdy with Logout function custom_logout_link() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( 'id' => 'wp-custom-logout', 'title' => 'Logout', 'parent'=> 'top-secondary', 'href' => wp_logout_url() ) ); $wp_admin_bar->remove_menu('my-account'); } add_action( 'wp_before_admin_bar_render', 'custom_logout_link' ); Editing the WordPress Admin Menus - https://whiteleydesigns.com/editing-wordpress-admin-menus/ Working With WordPress User Roles and Capabilities - https://wpshout.com/wordpress-user-roles-and-capabilities/ Removing Items From the WordPress Admin Bar - https://jasonyingling.me/removing-items-from-the-wordpress-admin-bar/ The Ultimate Guide to Roles and Capabilities in WordPress - https://wpmayor.com/roles-capabilities-wordpress/ How to Remove Menu Items in Admin Depending on User Role - https://wpmayor.com/how-to-remove-menu-items-in-admin-depending-on-user-role/ How to Add Submenu to Custom Post Type Menu in WordPress - https://njengah.com/wordpress-add-submenu-custom-post-type-menu/ How to add a custom link under...

WordPress User Login Redirect

WordPress sites that offer personalized or private content typically want to keep their users on the front end of the site.  However, WordPress automatically takes users to the back end dashboard after they login.  Obviously, we need to be able to redirect these users to the front end of the site; but at the same time, anyone who is an admin will probably still want to end up on the back end of the site. WordPress gives us the ability to edit where users are sent after they login by using the login_redirect filter. The code snippet below will allow you to...

Redirect Using Custom Code

To write your own custom redirect code, you should familiarize yourself with the login_redirect filter. This page will explain how the filter works, and there are a few examples of how to apply this knowledge in the comments. Here’s a very simple example to get you started: function custom_login_redirect() { return 'home_url()'; } add_filter('login_redirect', 'custom_login_redirect'); This code will cause all users to be redirected to the homepage when they log in to your site. That’s all it does! If you want, you can change “home_url()” to a URL of your choosing. For example, replacing ‘home_url()’ with ‘/blog’ will direct users to your site’s blog page.

How to Redirect User If Not Logged in WordPress » Page Redirect

In the last post, I demonstrated how to check if the user is logged in in WordPress.  One common reason why you may want to check if WordPress user is logged in is to show different pages based on the logged-in status of the WordPress user. If you want to redirect users if not logged in WordPress, you can achieve this by adding a code snippet in your functions.php file as you will see in this quick tutorial. Why redirect users in WordPress? Redirecting users is an important requirement for most WordPress sites. There are different times you may want to redirect users...

How to Create Login Page In WordPress Without Using Plugin (2 methods)

Are you looking for the best way to create login page in WordPress without a plugin and without customizing the default WordPress login page? If you want to create login page in WordPress without using the popular WordPress login plugins, you can do so by adding the login code in a shortcode or in a custom page template. In this tutorial, I will demonstrate how you can create login page in WordPress using a shortcode function and also how you can create a login page in WordPress using login function in a custom page template. Each of these ways should...

How to Get Logged In User Information in WordPress

Are you looking for the best way to get logged in user information in WordPress? In the previous, post I shared with you how to check if a user is logged in and also how to find the role of logged in user. In this post, I want to extend this by explaining how to get logged in user information in WordPress.  WordPress comes with a function that helps in getting user information. Check if the User is Logged In The first step to get the information of logged in the user needs to begin by checking if the user is logged in. I explained...

Creating Custom Front End Registration and Login Forms for WordPress

Front end registration and login forms (meaning placed within your site’s pages, and not the default wp-login.php) are one of the elements that really take a site out of the “standard WordPress” zone. With forms that allow your users to signup and login without ever leaving your main site, you provide a much more consistent and comfortable environment. They can provide that next level of integration that really makes your site zing. They also provide you (the developer/designer) a much higher level of control, especially in regards to styling and functionality. So it’s time to learn how to create them...

A visual guide to WordPress user login hooks

In this article we are going to discuss the WordPress hooks that are triggered during the user login process. WordPress calls many different actions and filters throughout its sign in process. If you need to customize the default WordPress login functionality, you will need to understand which hooks are called and at which point of the code execution they are called. That’s why we have created a detailed graphic that will help you understand the sequence of these hooks and how everything comes together. WordPress hooks is one of the most powerful features available to developers. WordPress fires various hooks throughout the...

Αλλάξτε το όνομα αποστολέα στα email του WordPress σας!

Το WordPress ως γνωστό, διαθέτει την δυνατότητα αποστολής ειδοποιήσεων στους διαχειριστές και τους χρήστες, μέσω email. Ως προεπιλογή στην θέση του ονόματος του αποστολέα στα email εμφανίζεται το "Wordpress".  Για να γίνει καλύτερα κατανοητό αυτό, ας δούμε ένα παράδειγμα! Αν ένας εγγεγραμμένος χρήστης του ιστότοπου σας, ξεχάσει τον κωδικό πρόσβασης στον λογαριασμό του και ζητήσει την δημιουργία ενός νέου κωδικού, το μήνυμα που θα λάβει στο email του με τις σχετικές πληροφορίες θα εμφανίζει ως όνομα αποστολέα το  "Wordpress" και όχι το όνομα του ιστότοπου σας. Για να αλλάξουμε το όνομα αποστολέα και να εμφανίζεται αυτό που θέλουμε εμείς, το μόνο που...

Show WordPress Login Form Anywhere Without a Plugin

You can add this code to your theme’s template file if you want to display your WordPress login form on any page without a WordPress login plugin, sidebar login widget, or footer area. <?php wp_login_form(); ?> This code will only display the general WordPress login page in the place where you add the code. If you want to add a custom WordPress form page with additional fields and options, then you can use this code: <?php $args = array( 'echo' => true, 'redirect' => 'http://wpsnipp.com', 'form_id' => 'loginform', 'label_username' => __( 'Username' ), 'label_password' => __( 'Password' ), 'label_remember' =>...