Title: Button in Admin Bar
Last modified: April 13, 2020

---

# Button in Admin Bar

 *  Resolved [greatness0013](https://wordpress.org/support/users/greatness0013/)
 * (@greatness0013)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/button-in-admin-bar/)
 * Would it be possible to add the button to the admin bar in addition to the dashboard?
   If so, how would I accomplish that?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [webheadcoder](https://wordpress.org/support/users/webheadllc/)
 * (@webheadllc)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/button-in-admin-bar/#post-12668617)
 * Glad you asked! I keep wanting to add that to the plugin, but was too lazy to
   add it without it being requested. This will be in the next version of the plugin.
 * If you want it now (because I’m not sure when the next version will be out), 
   you’ll need to modify the plugin code. Please do so only if you feel comfortable
   with modifying code. If anything goes wrong with your site, you can delete the
   plugin and start over. Make sure you have some kind of FTP access so you can 
   delete the plugin when your site is down.
 * In version 1.3, in the clear-cache-for-widgets.php file, on line 345, look for
 * `if ( isset( $_POST['ccfm'] ) ) {`
 * Replace it with
    `if ( isset( $_REQUEST['ccfm'] ) ) {`
 * Then add the following in the same file at the bottom on a new line:
 *     ```
       /**
        * add a link to the WP Toolbar
        */
       function ccfm_toolbar_link( $wp_admin_bar ) {
           $url = add_query_arg( '_wpnonce', wp_create_nonce( 'ccfm' ), admin_url() . '?ccfm=1' );
           $args = array(
               'id' => 'ccfm-link',
               'title' => 'Clear Cache For Me', 
               'href' => $url, 
               'meta' => array(
                   'title' => 'Clear Cache For Me'
               )
           );
           $wp_admin_bar->add_node( $args );
       }
       add_action( 'admin_bar_menu', 'ccfm_toolbar_link', 999 );
       ```
   
 * Again, modify the code at your own risk. Make sure you have a way to delete the
   files if you can’t access your WordPress dashboard.
 *  Thread Starter [greatness0013](https://wordpress.org/support/users/greatness0013/)
 * (@greatness0013)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/button-in-admin-bar/#post-12668706)
 * Thanks for this. I’ll report back with the results!
 *  Plugin Author [webheadcoder](https://wordpress.org/support/users/webheadllc/)
 * (@webheadllc)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/button-in-admin-bar/#post-12787935)
 * Got to this faster than I thought. This has been added in v1.4.
 *  Thread Starter [greatness0013](https://wordpress.org/support/users/greatness0013/)
 * (@greatness0013)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/button-in-admin-bar/#post-12790513)
 * Thank you for this! My IT hadn’t gotten to it yet for me to report results.
    -  This reply was modified 6 years, 1 month ago by [greatness0013](https://wordpress.org/support/users/greatness0013/).
    -  This reply was modified 6 years, 1 month ago by [greatness0013](https://wordpress.org/support/users/greatness0013/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Button in Admin Bar’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/clear-cache-for-widgets.svg)
 * [Clear Cache for Me](https://wordpress.org/plugins/clear-cache-for-widgets/)
 * [Support Threads](https://wordpress.org/support/plugin/clear-cache-for-widgets/)
 * [Active Topics](https://wordpress.org/support/plugin/clear-cache-for-widgets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/clear-cache-for-widgets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/clear-cache-for-widgets/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [greatness0013](https://wordpress.org/support/users/greatness0013/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/button-in-admin-bar/#post-12790513)
 * Status: resolved