Resource icon

WordPress Admin Bar: Log In or Sign Up 0.4

No permission to download

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

This code might help you integrate your logins between WordPress and XenForo. You will need the bridge by XenScripts installed.

Demo: www.tuxreportsdebates.com

View attachment 34225

Note: This is my first attempt at sharing something. I am learning PHP. Please let me know if you see something completely out of whack or you see a better way of handling this idea. For example, the CSS code be changed to right shift the login...

Read more about this resource...
 
Wolla! Can you make it mimic the Xenforo 'feel'. I like the drawer that slides down from the top.
 
Wolla! Can you make it mimic the Xenforo 'feel'. I like the drawer that slides down from the top.

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.
 
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.
Does it even fetch the XF menu like Inbox, Alerts, Logout; etc.?
 
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', false, basename( dirname( __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.
 
Top Bottom