1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress Admin Bar: Log In or Sign Up 0.4

A Little Code to Build Your Own Plugin

  1. LPH

    LPH Well-Known Member

    lph submitted a new resource:

    WordPress Admin Bar: Log In or Sign Up (version 0.4) - A Little Code to Build Your Own Plugin

    Read more about this resource...
     
  2. fattony69

    fattony69 Well-Known Member

    I was looking for this exact feature. I'll install this in a bit.
     
  3. LPH

    LPH Well-Known Member

    Remember to edit the links before you upload the files.:)
     
  4. TheBigK

    TheBigK Well-Known Member

    Wolla! Can you make it mimic the Xenforo 'feel'. I like the drawer that slides down from the top.
     
  5. LPH

    LPH Well-Known Member

    Well - I'm not good enough at JavaScript - but it would be nice. Maybe some of the code from XF can be borrowed to get it to work. I'll tinker - but maybe someone else can jump in too.
     
    TheBigK likes this.
  6. TheBigK

    TheBigK Well-Known Member

    Does it even fetch the XF menu like Inbox, Alerts, Logout; etc.?
     
  7. LPH

    LPH Well-Known Member

    @TheBigK - Sorry. This code was built for a multisite in which code presents links to the /community/login page if XenScripts is enabled or to /wp-login if not enabled.

    Now, I did find this ... http://www.red-team-design.com/simple-and-effective-dropdown-login-box

    Maybe that can be incorporated into the code to get a drop down but that will take lots of work to get to look like the XF.
     
  8. sweetpotato

    sweetpotato Active Member

    Could you please instruct how to install it.
    Thanks,
     
  9. sweetpotato

    sweetpotato Active Member

    Hello,
    I don't know if it's necessary to add this in your plugin
    PHP:
    if (function_exists('xenforo_thread_url'))
    I create a simple plugin for my site as bellow:
    PHP:
    <?php
     
    load_plugin_textdomain
    ('cyberim'falsebasenamedirname__FILE__ ) ) . '/languages' );
     
    /*
    * Add a Log In Link for Logged Out Users to the Admin Bar
    */
    function add_login_link$meta FALSE ) {
        global 
    $wp_admin_bar$blog_id;
        if ( 
    is_user_logged_in() ) { return false; }
        
    $wp_admin_bar->remove_menu('my-account');
        
    $wp_admin_bar->add_menu( array(
            
    'id' => 'login_menu',
            
    'parent' => 'top-secondary',
            
    'title' => __'Log in or Sign up','cyberim' ),
            
    'href' => get_home_url$blog_id'/wp-login.php' ) )
        );
    }
    add_filter'show_admin_bar''__return_true' ); /* turn on adminbar for logged out users */
    add_action'admin_bar_menu''add_login_link'15 );
     
    /* Removes parts of the admin bar */
     
    function wpzoom_admin_bar_remove() {
        global 
    $wp_admin_bar;
        
    /* Remove their stuff */
        
    $wp_admin_bar->remove_menu('about');
        
    $wp_admin_bar->remove_menu('wporg');
        
    $wp_admin_bar->remove_menu('documentation');
        
    $wp_admin_bar->remove_menu('support-forums');
        
    $wp_admin_bar->remove_menu('feedback');
        
    $wp_admin_bar->remove_menu('my-sites');
        
    $wp_admin_bar->remove_node('search');
        
    $wp_admin_bar->remove_menu('wpseo-menu');
           
    }
     
    add_action('wp_before_admin_bar_render''wpzoom_admin_bar_remove'0);
    /*
    * Replace default wp logo by cyberim logo
    */
    function cyberim_custom_logo() {
    echo 
    '
    <style type="text/css">
    #wp-admin-bar-wp-logo > .ab-item .ab-icon {
        background-image: url(' 
    get_bloginfo('stylesheet_directory') . '/images/cyberim_bar_logo.png) !important;
        width: 60px;
        background-position: 0 0;
        }
    #wpadminbar #wp-admin-bar-wp-logo.hover > .ab-item .ab-icon {
        background-position: 0 0;
        }   
    </style>
    '
    ;
    }
    add_action('wp_before_admin_bar_render''cyberim_custom_logo'0);
    ?>
    This plugin removes wp.org menus and replace wp logo by my logo. However, I could't remove wp about link under the logo.
     

Share This Page