Want the WP admin "Dashboard" menu link back?

  • JamesD
    JamesD
    Elite Member
     
    554 points

    Hello All,

    I’m not positive, but I think since version 8, of the PremiumPress responsive themes, the WP admin Dashboard link started being hidden, Personally, I use and like the button. :-)

    Perhaps it’ll return in a future version, but until then I’ve been using a plugin I made awhile back. So, if you’re the type that misses the link and would like to have it added back then keep reading.

    This plugin is very minimal and only serves the one purpose… to always keep the Dasboard menu link viewable in WP admin.

    All one needs to do is install the plugin and activate. No messing with ‘_functions.php’ or any other files. Quick and easy to implement.

    The plugin:

    1. Download the file
    2. install it using the method you typically use to install plugins (i.e. whether ftp, wp admin panel… etc).
    3. Go to the WP Plugins page and activate it.

    Once activated the link will always be displayed in the admin area until the plugin is deactivated. That’s it!.

    This is something that can be accomplished various way, but would require one to have such knowledge or would need to modify at least one file manually.

    And here’s the actual plugin file contents for those self-doers out there:

    <?php
    /** Kill direct call attempts */
    defined ( 'ABSPATH' ) or die ( "Cannot access pages directly ." );
    /**
    * @package CPhix PinDash
    *
    * **********************
    * File: /wp-content/plugins/cphix_pindash/pindash.php
    *
    * Plugin Name: [CPHIX] - PinDash
    * Description: Will keep the Dashboard menu link while using a PremiumPress Theme.
    * Version: 1.0.0
    * Author: JamesD
    * License: GPL2
    * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    * Text Domain: cphix-pindash
    * Domain Path:
    * Created: January 20, 2017
    * Last Modified: March 07, 2017
    * **********************
    License: GPL2

    Copyright 2016-2017 JamesD

    Portions of this program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as published
    by the Free Software Foundation.

    Portions of this program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    details.

    You should have received a copy of the GNU General Public License along with
    this program; if not, write to:
    Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
    * **********************/
    /**
    * Enqueue required style for dashboard menu
    * @param void
    * @return void
    */
    function pindash_admin_print_styles() {
    if ( current_user_can('activate_plugins') == true ) {
    if(wp_style_is('wlt_admin_styles'))
    wp_add_inline_style( 'wlt_admin_styles', '#adminmenu #menu-dashboard { display: list-item; }' );
    } else {
    if ( is_plugin_active('cphix_pindash/' . basename( __FILE__ ) ) )
    deactivate_plugins( 'cphix_pindash/' . basename( __FILE__ ) );
    }
    }
    add_action('admin_print_styles', 'pindash_admin_print_styles');

    Feel free to try it, modify as needed or whatever.

    Note: I have NOT tested this with a multi-site setup yet. It should be a quick fix if there was a problem. It’s been tested with WP 4.7+ and PP themes v8.6+.

    Hope some will find this helpful.

    Attachments:
    You must be logged in to view attached files.

    Marie
    Marie
    Super Guru
     
    1,124 points

    Brilliant!

    Thanks for sharing James :)


    JamesD
    JamesD
    Elite Member
     
    554 points

    @Marie

    Always glad to help.

    Just trying to make things more “hands-off” and easier for people when I can. :-)


    Marie
    Marie
    Super Guru
     
    1,124 points

    Glad to have you here in our community James :)

    We appreciate it :)


    Alex Morgan
    Alex Morgan
    Super Guru
     
    1,046 points

    Thanks for sharing james,

    will save this link for future references :)

    Thanks again!


    Josh
    Josh
    Super Guru
     
    13,888 points

    Thanks for sharing James :)


    JamesD
    JamesD
    Elite Member
     
    554 points

    @Josh

    My bad. I know I’ve seen various threads with people asking about it in the past, but didn’t see any solutions at the time I was looking for a method.

    I usually go through the older “no replies” posts first and try not to step on anyone’s thread that’s in the process of helping someone else… just to avoid more confusion for the people and not disrespect or contradict the helping developer/individual.

    I’ll stay clear, sorry if I did that.

    Keep up the good work Josh, I’ve noticed the change with your assistance over time ( years? 😉 ) and you definitely have had your hands full and been keeping busy. Kudos!


    Josh
    Josh
    Super Guru
     
    13,888 points

    Hello James,
    You are one of the most helpful member in the forum.Please you are free to share ideas and help out in the forum.
    Apologies if my response sounded harsh or anything.I have edited the post.


    JamesD
    JamesD
    Elite Member
     
    554 points

    Hi Josh,

    No, you’re fine. I just try to be mindful and wanted to make sure I didn’t do anything like that to you, but thank you.


    Chuck
    Chuck
    Newbie
     
    70 points

    Thanks for this plugin!

    I tried putting the direct dashboard URL in the browser (http://example.com/wp-admin/index.php) but that brings you to the login page and it won’t let you login! :(

    Therefore, without this plugin, you can’t access the WP dashboard, which is imperative if you use plugins that reply on using the dashboard, like Google Analytics Dashboard for WP.

    Please allow the WP Dashboard in future updates so we don’t have to rely on a plugin. No offense at all to JamesD.


    JamesD
    JamesD
    Elite Member
     
    554 points

    You’re welcome Chuck. I’m glad others have found use with it. :-)


Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.