Plugin Directory

Changeset 1110290


Ignore:
Timestamp:
03/11/2015 12:06:08 PM (11 years ago)
Author:
NikV
Message:

Updating to new version! 1.1

Location:
wp-ecommerce-toolbar/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-ecommerce-toolbar/trunk/readme.txt

    r1078693 r1110290  
    44Requires at least: 3.9
    55Tested up to: 4.1
    6 Stable tag: 1.0
     6Stable tag: 1.1
    77License: GNU GPLv2+
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424
    2525OR 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 =
     29Updates 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  
    22/**
    33 * 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
    56 * Author: Nikhil Vimal
    67 * Author URI: http://nik.techvoltz.com
    78 * Version: 1.0
    8  * Plugin URI:
    99 * License: GNU GPLv2+
    1010 */
     
    1212class WPecommerce_Admin_Bar {
    1313
    14 
     14    /**
     15     * Build the admin bar menu
     16     */
    1517    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 );
    1719
    1820    }
     
    3436    public function admin_bar_nodes( $wp_admin_bar ) {
    3537        //only displayed on site, not in admin
    36         if ( ! is_admin()) {
     38        if ( ! is_admin() ) {
    3739
    3840            // Main Parent Node
     
    4648                    'parent' => 'wp-logo',
    4749                    'id'    => 'wp_ecommerce_toolbar_about',
    48                     'title' => 'About WP eCommerce',
     50                    'title' => __( 'About WP eCommerce' ),
    4951                    'href'  => 'https://wpecommerce.org/',
    5052                )
     
    5456                    'parent' => 'wp_ecommerce_toolbar',
    5557                    'id'    => 'wp_ecommerce_toolbar_products',
    56                     'title' => 'Products',
     58                    'title' => get_post_type_object( 'wpsc-product' )->labels->name,
    5759                    'href' => admin_url('edit.php?post_type=wpsc-product'),
    5860                )
     
    6264                    'parent' => 'wp_ecommerce_toolbar_products',
    6365                    'id'    => 'wp_ecommerce_toolbar_products_new',
    64                     'title' => 'Add New',
     66                    'title' => get_post_type_object( 'wpsc-product' )->labels->add_new_item,
    6567                    'href' => admin_url('post-new.php?post_type=wpsc-product'),
    6668                )
     
    7072                    'parent' => 'wp_ecommerce_toolbar',
    7173                    'id'    => 'wp_ecommerce_toolbar_coupons',
    72                     'title' => 'Coupons',
     74                    'title' => __( 'Coupons' ),
    7375                    'href' => admin_url('edit.php?post_type=wpsc-product&page=wpsc-edit-coupons'),
    7476                )
     
    7880                    'parent' => 'wp_ecommerce_toolbar_coupons',
    7981                    'id'    => 'wp_ecommerce_toolbar_coupons_new',
    80                     'title' => 'Add New',
     82                    'title' => __( 'Add New' ),
    8183                    'href' => admin_url('edit.php?post_type=wpsc-product&page=wpsc-edit-coupons&wpsc-action=add_coupon'),
    8284                )
     
    8688                    'parent' => 'wp_ecommerce_toolbar',
    8789                    'id'    => 'wp_ecommerce_toolbar_variations',
    88                     'title' => 'Variations',
     90                    'title' => get_taxonomy( 'wpsc-variation' )->labels->name,
    8991                    'href' => admin_url('edit-tags.php?taxonomy=wpsc-variation&post_type=wpsc-product'),
    9092                )
     
    9496                    'parent' => 'wp_ecommerce_toolbar',
    9597                    'id'    => 'wp_ecommerce_toolbar_settings',
    96                     'title' => 'Settings',
     98                    'title' => __( 'Settings' ),
    9799                    'href' => admin_url('options-general.php?page=wpsc-settings&tab=general'),
    98100                )
     
    106108}
    107109
    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');
     110add_action( 'wpsc_init', 'WPecommerce_Admin_Bar::init' );
Note: See TracChangeset for help on using the changeset viewer.