Private slug shown in source page
-
Hi,
thank you for this plugin.
I notice that the wp_logout_url() WordPress function generates a link where the secret slug is present.
Something like https://my-website.com/admin-secret-slug-123/?action=logout&redirect_to=https://my-website.com
Isn’t it a security issue ? I don’t like the private slug to be public.
So I wrote a quick fix for this, but would like an answer from you.
function lc_logout_url( $logout_url ) {
if ( $whl_page_login = get_site_option( ‘whl_page’, ‘login’ ) ) {
$logout_url = str_replace( $whl_page_login . ‘/’, ”, $logout_url );
}
return $logout_url;
}
add_filter( ‘logout_url’, ‘lc_logout_url’, 30, 1 );function lc_init_logout_url() {
if ( isset( $_GET[‘action’] ) && ‘logout’ == $_GET[‘action’] ) {
wp_logout();
}
}
add_action( ‘init’, ‘lc_init_logout_url’ );I thank you in advance.
- The topic ‘Private slug shown in source page’ is closed to new replies.