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

Common header for multisite

Discussion in 'Web Development' started by LPH, Apr 13, 2012.

  1. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
  2. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
  3. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735
    I found it easier to start modifying the admin bar in WordPress. This doesn't give me the bar in XenForo but it is a start.

    I modified scripts found on different websites and started adding, subtracting, and modifying. You are welcome to do the same.

    Code (Text):
    1. <?php
    2. /*
    3. Plugin Name: WordPress Admin Bar Modifications
    4. Plugin URI: http://www.layneheiny.com
    5. Description: Remove WP Logo from the admin bar, remove my sites, add new links for tuxreports network.
    6. Version: 0.1
    7. Author: Layne P. Heiny
    8. Author URI: http://www.layneheiny.com/
    9. */
    10.  
    11. function annointed_admin_bar_remove() {
    12.         global $wp_admin_bar;
    13.  
    14.         /* Remove their stuff */
    15.         $wp_admin_bar->remove_menu('wp-logo');
    16.         $wp_admin_bar->remove_menu('my-sites');
    17. }
    18.  
    19. add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);
    20.  
    21.  
    22. function add_trn_admin_bar_link() {
    23.     global $wp_admin_bar;
    24.     if ( !is_super_admin() || !is_admin_bar_showing() )
    25.         return;
    26.     $wp_admin_bar->add_menu( array(
    27.     'id' => 'trn_link',
    28.     'title' => __( 'Tux Reports Network'),
    29.     'href' => __('http://www.tuxreportsnetwork.com'),
    30.     ));
    31.  
    32.     // Add sub menu link "View All Posts"
    33.     $wp_admin_bar->add_menu( array(
    34.         'parent' => 'trn_link',
    35.         'id'    => 'trn_all',
    36.         'title' => __( 'Communmity'),
    37.         'href' => __('http://www.tuxreportsdebates.com'),
    38.     ));
    39.  
    40.     // Add sub menu link "Downloads"
    41.     $wp_admin_bar->add_menu( array(
    42.         'parent' => 'trn_link',
    43.         'id'    => 'trn_technology',
    44.         'title' => __( 'Technology'),
    45.         'href' => __('http://www.tuxreportstech.com'),
    46.         'meta'  => array(
    47.             'class' => 'st_menu_download',),
    48.     ));
    49.         $wp_admin_bar->add_menu( array(
    50.             'parent' => 'trn_technology',
    51.             'id'    => 'trn_amd',
    52.             'title' => __( 'AMD Views'),
    53.             'href' => __('http://www.amdviews.com'),
    54.         ));
    55. }
    56. add_action('admin_bar_menu', 'add_trn_admin_bar_link',25);
    57.  
    58. ?>
     
  4. LPH

    LPH Flight Director Flight Instructor

    Likes Received:
    735

Share This Page