Thread Starter
itskev
(@itskev)
Thanks Jeff. I saw that. I’m not sure how that helps me. Instructions say “In order to change the links that display here, consider the following code:”
So I consider it. That’s it? It would be greatly helpful for the page to tell me more than just to consider it.
I tried copying that code into a custom php file and removing some of it. Is that considering it? I don’t want to change the code of the two php file and have them written over from an update. This is the content in the custom php file. I removed the profile code from the all other roles.
<?php
function filter_tml_widget_user_links( $links ) {
$user = wp_get_current_user();
$role = reset( $user->roles );
if ( empty( $role ) ) {
$role = 'subscriber';
}
if ( is_super_admin() ) {
$role = 'administrator';
}
// These links are for authors, editors and admins
if ( in_array( $role, array( 'author', 'editor', 'administrator' ) ) ) {
$links = array(
'profile' => array(
'title' => __( 'Profile' ),
'url' => admin_url( 'profile.php' ),
),
'logout' => array(
'title' => __( 'Log Out' ),
'url' => wp_logout_url(),
),
);
// These are for all other roles
} else {
$links = array(
'logout' => array(
'title' => __( 'Log Out' ),
'url' => wp_logout_url(),
),
);
}
return $links;
}
add_filter( 'tml_widget_user_links', 'filter_tml_widget_user_links' );
You’ll want to place the code in theme-my-login-custom.php.
Thread Starter
itskev
(@itskev)
Thanks Jeff. I did that, but it didn’t change anything when I took out part of it. I ended up taking it out of the two php files that governed it. I would rather use that custom php file but as of right now, it doesn’t work.
Can you confirm where you placed that file?
Thread Starter
itskev
(@itskev)
The file is located:
wp-content/plugins/theme-my-login/theme-my-login-custom.php
Thread Starter
itskev
(@itskev)
Apparently, I am supposed to put this php file here:
wp-content/plugins/
And that was my issue.