Skip to content

Instantly share code, notes, and snippets.

@rsharrer
Created September 26, 2013 13:35
Show Gist options
  • Save rsharrer/6714274 to your computer and use it in GitHub Desktop.
Save rsharrer/6714274 to your computer and use it in GitHub Desktop.
Custom Customer Plugin Starter
<?php
/**
*
* Plugin Name: Custom Client Plugin
* Plugin URI: http://webdesign.com/
* Description: Add custom tweaks to a client's site
* Version: 1.0.0
* Author: Benjamin Bradley
* Author URI: http://www.benjaminbradley.com/
*
*/
/*Add Custom CSS*/
add_action('wp_enqueue_scripts','bb_custom_admin_style');
add_action('admin_enqueue_scripts','bb_custom_admin_style');
function bb_custom_admin_style() {
wp_register_style('bb_menu_tb_style', plugins_url('style.css', __FILE__));
wp_enqueue_style('bb_menu_tb_style');
}
add_action('admin_bar_menu', 'bb_custom_tbmenu', 100);
function bb_custom_tbmenu($admin_bar) {
$admin_bar->add_menu(array(
'id' => 'wpstudio',
'title' => '413Media Designs',
'href' => 'http://413media.com',
'meta' => array(
'title' => __('413Media Designs'),
),
));
$admin_bar->add_menu(array(
'id' => 'support',
'parent' => 'wpstudio',
'title' => 'Contact Support',
'href' => 'http://413Media.com/contact',
'meta' => array(
'title' => __('Contact Support'),
'target' => '_blank',
'class' => 'bb_support_link'
),
));
$admin_bar->add_menu(array(
'id' => 'billing',
'parent'=> 'wpstudio',
'title' => 'Pay Your Bill',
'href' => 'http://413Media.com/billing',
'meta' => array(
'title' => __('Pay Your Bill'),
'target' => '_blank',
'class' => 'bb_billing_link'
),
));
$admin_bar->add_menu(array(
'id' => 'news',
'parent' => 'wpstudio',
'title' => 'Latest News',
'href' => 'http://413Media.com/news',
'meta' => array(
'title' => __('Latest News'),
'target' => '_blank',
'class' => 'bb_news_link'
),
));
$admin_bar->add_menu(array(
'id' => 'deals',
'parent' => 'wpstudio',
'title' => 'Deals & Coupons',
'href' => 'http://413Media.com/deals',
'meta' => array(
'title' => __('Deals & Coupons'),
'target' => '_blank',
'class' => 'bb_deals_link'
),
));
$admin_bar->remove_menu('wp-logo');
}
/*Dashboard Widget*/
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget','413Media Developer Inc', 'custom_dashboard_help');
}
function custom_dashboard_help() {
echo '<p>Welcome to Custom Blog Theme! Need help? Contact the developer <a href="mailto:email@gmail.com">here</a>. For WordPress Tutorials visit: <a href="http://www.webdesign.com" target="_blank">WebDesign.com</a></p>';
}
add_action('wp_dashboard_setup','my_custom_dashboard_widgets', 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment