Title: A little hack &#8230;
Last modified: February 18, 2021

---

# A little hack …

 *  [markingston](https://wordpress.org/support/users/markingston/)
 * (@markingston)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/a-little-hack/)
 * Hello,
    I thought I might sahe this little hack. I was looking to put a Logout
   link on the dashboard. The problem was that your code was forcing : `/wp-admin/`
 * So I ended up taking it out:
    `$admin_url = site_url(); //$admin_url = site_url()."/
   wp-admin/";` …and adding it back into the Dashboard Widget Links : /wp-admin/
   profile.php
 * This then means I can also use : /wp-login.php?action=logout
 * I hope you don’t mind… maybe a little **tick box** or a **test** could be integrated
   in a future release.
 * By the way I love this plugin.

Viewing 1 replies (of 1 total)

 *  Thread Starter [markingston](https://wordpress.org/support/users/markingston/)
 * (@markingston)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/a-little-hack/#post-14068883)
 * Haha,
    replying to my own post here… I didn’t read your code far enough. I see
   you already have a switch:
 *     ```
       if(strpos($item['link'] , 'http') ===false){ //not full link
       					$link = ($item['link'] != 'site_url')? $admin_url.$item['link'] : home_url();
       				}else{
       					$link = $item['link'];
       				}
       ```
   
 * So sorry for my previous hack. I guess if I just put in a full URL your code 
   will handle my need without the need for a **tick box** or a **test**!
 * Sorry for any confusion. All the best.

Viewing 1 replies (of 1 total)

The topic ‘A little hack …’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-dashboard-widgets_e2e2e2.svg)
 * [Custom Dashboard Widgets](https://wordpress.org/plugins/custom-dashboard-widgets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-dashboard-widgets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-dashboard-widgets/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-dashboard-widgets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-dashboard-widgets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-dashboard-widgets/reviews/)

## Tags

 * [Logout](https://wordpress.org/support/topic-tag/logout/)
 * [release](https://wordpress.org/support/topic-tag/release/)
 * [wp-admin](https://wordpress.org/support/topic-tag/wp-admin/)

 * 1 reply
 * 1 participant
 * Last reply from: [markingston](https://wordpress.org/support/users/markingston/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/a-little-hack/#post-14068883)
 * Status: not a support question