Changeset 1110290
- Timestamp:
- 03/11/2015 12:06:08 PM (11 years ago)
- Location:
- wp-ecommerce-toolbar/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-ecommerce-toolbar.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-ecommerce-toolbar/trunk/readme.txt
r1078693 r1110290 4 4 Requires at least: 3.9 5 5 Tested up to: 4.1 6 Stable tag: 1. 06 Stable tag: 1.1 7 7 License: GNU GPLv2+ 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 24 24 25 25 OR you can just install it with WordPress by going to Plugins >> Add New >> and type this plugin\'s name 26 27 == Changelog == 28 = 1.1 = 29 Updates in the code, mostly a better way to setup the menu, check if WPeC exists, etc. -
wp-ecommerce-toolbar/trunk/wp-ecommerce-toolbar.php
r1078693 r1110290 2 2 /** 3 3 * Plugin Name: WP eCommerce Toolbar 4 * Description: A simple toolbar extension for users of The WPeCommerce plugin 4 * Plugin URI: https://wordpress.org/plugins/wp-ecommerce-toolbar/ 5 * Description: A simple toolbar extension for users of The WP eCommerce plugin 5 6 * Author: Nikhil Vimal 6 7 * Author URI: http://nik.techvoltz.com 7 8 * Version: 1.0 8 * Plugin URI:9 9 * License: GNU GPLv2+ 10 10 */ … … 12 12 class WPecommerce_Admin_Bar { 13 13 14 14 /** 15 * Build the admin bar menu 16 */ 15 17 public function __construct() { 16 add_action( 'admin_bar_menu', array( $this, 'admin_bar_nodes'), 999);18 add_action( 'admin_bar_menu', array( $this, 'admin_bar_nodes' ), 999 ); 17 19 18 20 } … … 34 36 public function admin_bar_nodes( $wp_admin_bar ) { 35 37 //only displayed on site, not in admin 36 if ( ! is_admin() ) {38 if ( ! is_admin() ) { 37 39 38 40 // Main Parent Node … … 46 48 'parent' => 'wp-logo', 47 49 'id' => 'wp_ecommerce_toolbar_about', 48 'title' => 'About WP eCommerce',50 'title' => __( 'About WP eCommerce' ), 49 51 'href' => 'https://wpecommerce.org/', 50 52 ) … … 54 56 'parent' => 'wp_ecommerce_toolbar', 55 57 'id' => 'wp_ecommerce_toolbar_products', 56 'title' => 'Products',58 'title' => get_post_type_object( 'wpsc-product' )->labels->name, 57 59 'href' => admin_url('edit.php?post_type=wpsc-product'), 58 60 ) … … 62 64 'parent' => 'wp_ecommerce_toolbar_products', 63 65 'id' => 'wp_ecommerce_toolbar_products_new', 64 'title' => 'Add New',66 'title' => get_post_type_object( 'wpsc-product' )->labels->add_new_item, 65 67 'href' => admin_url('post-new.php?post_type=wpsc-product'), 66 68 ) … … 70 72 'parent' => 'wp_ecommerce_toolbar', 71 73 'id' => 'wp_ecommerce_toolbar_coupons', 72 'title' => 'Coupons',74 'title' => __( 'Coupons' ), 73 75 'href' => admin_url('edit.php?post_type=wpsc-product&page=wpsc-edit-coupons'), 74 76 ) … … 78 80 'parent' => 'wp_ecommerce_toolbar_coupons', 79 81 'id' => 'wp_ecommerce_toolbar_coupons_new', 80 'title' => 'Add New',82 'title' => __( 'Add New' ), 81 83 'href' => admin_url('edit.php?post_type=wpsc-product&page=wpsc-edit-coupons&wpsc-action=add_coupon'), 82 84 ) … … 86 88 'parent' => 'wp_ecommerce_toolbar', 87 89 'id' => 'wp_ecommerce_toolbar_variations', 88 'title' => 'Variations',90 'title' => get_taxonomy( 'wpsc-variation' )->labels->name, 89 91 'href' => admin_url('edit-tags.php?taxonomy=wpsc-variation&post_type=wpsc-product'), 90 92 ) … … 94 96 'parent' => 'wp_ecommerce_toolbar', 95 97 'id' => 'wp_ecommerce_toolbar_settings', 96 'title' => 'Settings',98 'title' => __( 'Settings' ), 97 99 'href' => admin_url('options-general.php?page=wpsc-settings&tab=general'), 98 100 ) … … 106 108 } 107 109 108 function load_wpecommerce_admin_bar() { 109 if( !function_exists( 'is_plugin_active' ) ) { 110 include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 111 } 112 113 //Check if plugin is activated, or else... 114 if( is_plugin_active( 'wp-e-commerce/wp-shopping-cart.php' ) ) { 115 116 return WPecommerce_Admin_Bar::init(); 117 118 } 119 120 } 121 add_action('plugins_loaded', 'load_wpecommerce_admin_bar'); 110 add_action( 'wpsc_init', 'WPecommerce_Admin_Bar::init' );
Note: See TracChangeset
for help on using the changeset viewer.