Instantly share code, notes, and snippets.
Created
April 9, 2013 01:31
-
Save bhubbard/5342177 to your computer and use it in GitHub Desktop.
Add IDX Broker Links to Wordpress Admin Menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/************************************************************************** | |
Plugin Name: IDX Links Menu | |
Plugin URI: | |
Description: Add IDX Broker Platinum Links to Menu Bar | |
Version: 1.0 | |
Author: Brandon Hubbard | |
License: GPLv2 or later | |
**************************************************************************/ | |
################################################################################ | |
// Add IDX Broker Links to Admin Menu | |
################################################################################ | |
function idxbrokerplatinum_add_admin_bar_link() { | |
global $wp_admin_bar; | |
if ( !is_admin_bar_showing() ) | |
return; | |
$wp_admin_bar->add_menu( array( | |
'id' => 'idxbroker_link', | |
'title' => __( '<img src="http://www.idxbroker.com/images/logoTM.png" class="idxbroker-logo" style="margin: 0 5px -5px 0 !important;height:16px;" /> ' ), | |
//'title' => __( 'IDX Broker Platinum'), | |
'href' => __('http://idxbroker.com'), | |
"meta" => array("target" => "blank") | |
)); | |
// Add sub menu link "Account Login" | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_link', | |
'id' => 'idx_acct_login', | |
'title' => __( 'Account Login'), | |
'href' => __('https://middleware.idxbroker.com/mgmt/login.php'), | |
"meta" => array("target" => "blank") | |
)); | |
// Add sub menu link "Connect" | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_link', | |
'id' => 'idxbroker_social', | |
'title' => __( 'Elsewhere'), | |
'meta' => array( | |
'class' => 'idx_menu_social',) | |
)); | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_social', | |
'id' => 'idxbroker_facebook', | |
'title' => __( 'Facebook'), | |
'href' => __('http://www.facebook.com/#%21/pages/IDX/50711014225'), | |
"meta" => array("target" => "blank") | |
)); | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_social', | |
'id' => 'idxbroker_twitter', | |
'title' => __( 'Twitter'), | |
'href' => __('http://www.twitter.com/idxbroker'), | |
"meta" => array("target" => "blank") | |
)); | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_social', | |
'id' => 'idxbroker_pinterest', | |
'title' => __( 'Pinterest'), | |
'href' => __('http://pinterest.com/idxbroker/'), | |
"meta" => array("target" => "blank") | |
)); | |
// Google Plus | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_social', | |
'id' => 'idxbroker_googleplus', | |
'title' => __( 'Google Plus'), | |
'href' => __('https://plus.google.com/103359300154524667509'), | |
"meta" => array("target" => "blank") | |
)); | |
// YouTube | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_social', | |
'id' => 'idxbroker_youtube', | |
'title' => __( 'YouTube'), | |
'href' => __('https://www.youtube.com/user/idxincorporated'), | |
"meta" => array("target" => "blank") | |
)); | |
// Add sub menu "Support" | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_link', | |
'id' => 'idxbroker_support', | |
'title' => __( 'Support'), | |
)); | |
// Add sub menu link "Knowledgebase" | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_support', | |
'id' => 'idxbroker_knowledgebase', | |
'title' => __( 'KnowledgeBase'), | |
'href' => __('http://kb.idxbroker.com'), | |
"meta" => array("target" => "blank") | |
)); | |
// Add sub menu link "Contact Info" | |
$wp_admin_bar->add_menu( array( | |
'parent' => 'idxbroker_support', | |
'id' => 'idxbroker_contactus', | |
'title' => __( 'Contact Information'), | |
'href' => __('http://www.idxbroker.com/contact_idx.php'), | |
"meta" => array("target" => "blank") | |
)); | |
} | |
add_action('admin_bar_menu', 'idxbrokerplatinum_add_admin_bar_link',25); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment