From d2cadeb112846763f1d7e80eb0be128b96ad5c3e Mon Sep 17 00:00:00 2001 From: Yann Weyer Date: Tue, 14 Jul 2020 17:02:03 +0200 Subject: [PATCH] Manage admin links in PHP Adding ` -HEAD; +/* + * Remove admin links for non-authenticated users +*/ +yourls_add_filter('admin_links', 'sleeky_admin_links'); +function sleeky_admin_links($links) +{ + if (true !== yourls_is_valid_user()) { + $links = []; + } + + $links['frontend_link'] = [ + 'url' => yourls_site_url(false, '/'), + 'title' => yourls__( 'Frontend Interface' ), + 'anchor' => 'arrow_back ' . yourls__( 'Frontend Interface' ) + ]; + + return $links; }