Merge branch 'branding-improvements'
This commit is contained in:
commit
60cfe09c64
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
var a=this;d.onRenderMenu.add(function(c,b){
|
var a=this;d.onRenderMenu.add(function(c,b){
|
||||||
|
|
||||||
a.addImmediate(b, ed.getLang('woocommerce.order_tracking'),"[woocommerce_order_tracking]" );
|
a.addImmediate(b, ed.getLang('woocommerce.order_tracking'), '[' + ed.getLang('woocommerce.order_tracking_shortcode') + ']' );
|
||||||
a.addImmediate(b, ed.getLang('woocommerce.price_button'), '[add_to_cart id="" sku=""]');
|
a.addImmediate(b, ed.getLang('woocommerce.price_button'), '[add_to_cart id="" sku=""]');
|
||||||
a.addImmediate(b, ed.getLang('woocommerce.product_by_sku'), '[product id="" sku=""]');
|
a.addImmediate(b, ed.getLang('woocommerce.product_by_sku'), '[product id="" sku=""]');
|
||||||
a.addImmediate(b, ed.getLang('woocommerce.products_by_sku'), '[products ids="" skus=""]');
|
a.addImmediate(b, ed.getLang('woocommerce.products_by_sku'), '[products ids="" skus=""]');
|
||||||
|
@ -33,17 +33,7 @@
|
||||||
|
|
||||||
b.addSeparator();
|
b.addSeparator();
|
||||||
|
|
||||||
a.addImmediate(b, ed.getLang('woocommerce.shop_messages'), '[woocommerce_messages]');
|
a.addImmediate(b, ed.getLang('woocommerce.shop_messages'), '[' + ed.getLang('woocommerce.shop_messages_shortcode') + ']');
|
||||||
|
|
||||||
b.addSeparator();
|
|
||||||
|
|
||||||
c=b.addMenu({title:ed.getLang('woocommerce.pages')});
|
|
||||||
a.addImmediate(c, ed.getLang('woocommerce.cart'),"[woocommerce_cart]" );
|
|
||||||
a.addImmediate(c, ed.getLang('woocommerce.checkout'),"[woocommerce_checkout]" );
|
|
||||||
a.addImmediate(c, ed.getLang('woocommerce.my_account'),"[woocommerce_my_account]" );
|
|
||||||
a.addImmediate(c, ed.getLang('woocommerce.pay'),"[woocommerce_pay]" );
|
|
||||||
a.addImmediate(c, ed.getLang('woocommerce.thankyou'),"[woocommerce_thankyou]" );
|
|
||||||
|
|
||||||
});
|
});
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
(function(){tinymce.create("tinymce.plugins.WooCommerceShortcodes",{init:function(e,t){},createControl:function(e,t){var n=tinymce.activeEditor;if(e=="woocommerce_shortcodes_button"){e=t.createMenuButton("woocommerce_shortcodes_button",{title:n.getLang("woocommerce.insert"),icons:!1});var r=this;e.onRenderMenu.add(function(e,t){r.addImmediate(t,n.getLang("woocommerce.order_tracking"),"[woocommerce_order_tracking]");r.addImmediate(t,n.getLang("woocommerce.price_button"),'[add_to_cart id="" sku=""]');r.addImmediate(t,n.getLang("woocommerce.product_by_sku"),'[product id="" sku=""]');r.addImmediate(t,n.getLang("woocommerce.products_by_sku"),'[products ids="" skus=""]');r.addImmediate(t,n.getLang("woocommerce.product_categories"),'[product_categories number=""]');r.addImmediate(t,n.getLang("woocommerce.products_by_cat_slug"),'[product_category category="" per_page="12" columns="4" orderby="date" order="desc"]');t.addSeparator();r.addImmediate(t,n.getLang("woocommerce.recent_products"),'[recent_products per_page="12" columns="4" orderby="date" order="desc"]');r.addImmediate(t,n.getLang("woocommerce.featured_products"),'[featured_products per_page="12" columns="4" orderby="date" order="desc"]');t.addSeparator();r.addImmediate(t,n.getLang("woocommerce.shop_messages"),"[woocommerce_messages]");t.addSeparator();e=t.addMenu({title:n.getLang("woocommerce.pages")});r.addImmediate(e,n.getLang("woocommerce.cart"),"[woocommerce_cart]");r.addImmediate(e,n.getLang("woocommerce.checkout"),"[woocommerce_checkout]");r.addImmediate(e,n.getLang("woocommerce.my_account"),"[woocommerce_my_account]");r.addImmediate(e,n.getLang("woocommerce.pay"),"[woocommerce_pay]");r.addImmediate(e,n.getLang("woocommerce.thankyou"),"[woocommerce_thankyou]")});return e}return null},addImmediate:function(e,t,n){e.add({title:t,onclick:function(){tinyMCE.activeEditor.execCommand("mceInsertContent",!1,n)}})}});tinymce.PluginManager.add("WooCommerceShortcodes",tinymce.plugins.WooCommerceShortcodes)})();
|
(function(){tinymce.create("tinymce.plugins.WooCommerceShortcodes",{init:function(e,t){},createControl:function(e,t){var n=tinymce.activeEditor;if(e=="woocommerce_shortcodes_button"){e=t.createMenuButton("woocommerce_shortcodes_button",{title:n.getLang("woocommerce.insert"),icons:!1});var r=this;e.onRenderMenu.add(function(e,t){r.addImmediate(t,n.getLang("woocommerce.order_tracking"),"["+n.getLang("woocommerce.order_tracking_shortcode")+"]");r.addImmediate(t,n.getLang("woocommerce.price_button"),'[add_to_cart id="" sku=""]');r.addImmediate(t,n.getLang("woocommerce.product_by_sku"),'[product id="" sku=""]');r.addImmediate(t,n.getLang("woocommerce.products_by_sku"),'[products ids="" skus=""]');r.addImmediate(t,n.getLang("woocommerce.product_categories"),'[product_categories number=""]');r.addImmediate(t,n.getLang("woocommerce.products_by_cat_slug"),'[product_category category="" per_page="12" columns="4" orderby="date" order="desc"]');t.addSeparator();r.addImmediate(t,n.getLang("woocommerce.recent_products"),'[recent_products per_page="12" columns="4" orderby="date" order="desc"]');r.addImmediate(t,n.getLang("woocommerce.featured_products"),'[featured_products per_page="12" columns="4" orderby="date" order="desc"]');t.addSeparator();r.addImmediate(t,n.getLang("woocommerce.shop_messages"),"["+n.getLang("woocommerce.shop_messages_shortcode")+"]")});return e}return null},addImmediate:function(e,t,n){e.add({title:t,onclick:function(){tinyMCE.activeEditor.execCommand("mceInsertContent",!1,n)}})}});tinymce.PluginManager.add("WooCommerceShortcodes",tinymce.plugins.WooCommerceShortcodes)})();
|
|
@ -11,11 +11,9 @@ $strings = 'tinyMCE.addI18n({' . _WP_Editors::$mce_locale . ':{
|
||||||
recent_products: "' . esc_js( __( 'Recent products', 'woocommerce' ) ) . '",
|
recent_products: "' . esc_js( __( 'Recent products', 'woocommerce' ) ) . '",
|
||||||
featured_products: "' . esc_js( __( 'Featured products', 'woocommerce' ) ) . '",
|
featured_products: "' . esc_js( __( 'Featured products', 'woocommerce' ) ) . '",
|
||||||
shop_messages: "' . esc_js( __( 'Shop Messages', 'woocommerce' ) ) . '",
|
shop_messages: "' . esc_js( __( 'Shop Messages', 'woocommerce' ) ) . '",
|
||||||
pages: "' . esc_js( __( 'Pages', 'woocommerce' ) ) . '",
|
|
||||||
cart: "' . esc_js( __( 'Cart', 'woocommerce' ) ) . '",
|
|
||||||
checkout: "' . esc_js( __( 'Checkout', 'woocommerce' ) ) . '",
|
|
||||||
order_tracking: "' . esc_js( __( 'Order tracking', 'woocommerce' ) ) . '",
|
order_tracking: "' . esc_js( __( 'Order tracking', 'woocommerce' ) ) . '",
|
||||||
my_account: "' . esc_js( __( 'My Account', 'woocommerce' ) ) . '",
|
my_account: "' . esc_js( __( 'My Account', 'woocommerce' ) ) . '",
|
||||||
edit_address: "' . esc_js( __( 'Edit Address', 'woocommerce' ) ) . '",
|
shop_messages_shortcode: "' . esc_js( apply_filters( "shop_messages_shortcode_tag", 'woocommerce_shop_messages' ) ) . '",
|
||||||
|
order_tracking_shortcode: "' . esc_js( apply_filters( "woocommerce_order_tracking_shortcode_tag", 'woocommerce_order_tracking' ) ) . '"
|
||||||
}
|
}
|
||||||
}})';
|
}})';
|
|
@ -221,7 +221,7 @@ class WC_Admin_Assets {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reports Pages
|
// Reports Pages
|
||||||
if ( in_array( $screen->id, apply_filters( 'woocommerce_reports_screen_ids', array( $wc_screen_id . '_page_wc_reports', 'dashboard' ) ) ) ) {
|
if ( in_array( $screen->id, apply_filters( 'woocommerce_reports_screen_ids', array( $wc_screen_id . '_page_wc-reports', 'dashboard' ) ) ) ) {
|
||||||
wp_enqueue_script( 'wc-reports', WC()->plugin_url() . '/assets/js/admin/reports' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker' ), '1.0' );
|
wp_enqueue_script( 'wc-reports', WC()->plugin_url() . '/assets/js/admin/reports' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker' ), '1.0' );
|
||||||
wp_enqueue_script( 'flot', WC()->plugin_url() . '/assets/js/admin/jquery.flot' . $suffix . '.js', array( 'jquery' ), '1.0' );
|
wp_enqueue_script( 'flot', WC()->plugin_url() . '/assets/js/admin/jquery.flot' . $suffix . '.js', array( 'jquery' ), '1.0' );
|
||||||
wp_enqueue_script( 'flot-resize', WC()->plugin_url() . '/assets/js/admin/jquery.flot.resize' . $suffix . '.js', array('jquery', 'flot'), '1.0' );
|
wp_enqueue_script( 'flot-resize', WC()->plugin_url() . '/assets/js/admin/jquery.flot.resize' . $suffix . '.js', array('jquery', 'flot'), '1.0' );
|
||||||
|
|
|
@ -231,7 +231,7 @@ class WC_Admin_Attributes {
|
||||||
<div class="wrap woocommerce">
|
<div class="wrap woocommerce">
|
||||||
<div class="icon32 icon32-attributes" id="icon-woocommerce"><br/></div>
|
<div class="icon32 icon32-attributes" id="icon-woocommerce"><br/></div>
|
||||||
<h2><?php _e( 'Edit Attribute', 'woocommerce' ) ?></h2>
|
<h2><?php _e( 'Edit Attribute', 'woocommerce' ) ?></h2>
|
||||||
<form action="admin.php?page=woocommerce_attributes&edit=<?php echo absint( $edit ); ?>" method="post">
|
<form action="admin.php?page=product_attributes&edit=<?php echo absint( $edit ); ?>" method="post">
|
||||||
<table class="form-table">
|
<table class="form-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="form-field form-required">
|
<tr class="form-field form-required">
|
||||||
|
@ -321,7 +321,7 @@ class WC_Admin_Attributes {
|
||||||
|
|
||||||
<td><a href="edit-tags.php?taxonomy=<?php echo esc_html(wc_attribute_taxonomy_name($tax->attribute_name)); ?>&post_type=product"><?php echo esc_html( $tax->attribute_label ); ?></a>
|
<td><a href="edit-tags.php?taxonomy=<?php echo esc_html(wc_attribute_taxonomy_name($tax->attribute_name)); ?>&post_type=product"><?php echo esc_html( $tax->attribute_label ); ?></a>
|
||||||
|
|
||||||
<div class="row-actions"><span class="edit"><a href="<?php echo esc_url( add_query_arg('edit', $tax->attribute_id, 'admin.php?page=woocommerce_attributes') ); ?>"><?php _e( 'Edit', 'woocommerce' ); ?></a> | </span><span class="delete"><a class="delete" href="<?php echo esc_url( wp_nonce_url( add_query_arg('delete', $tax->attribute_id, 'admin.php?page=woocommerce_attributes'), 'woocommerce-delete-attribute_' . $tax->attribute_id ) ); ?>"><?php _e( 'Delete', 'woocommerce' ); ?></a></span></div>
|
<div class="row-actions"><span class="edit"><a href="<?php echo esc_url( add_query_arg('edit', $tax->attribute_id, 'admin.php?page=product_attributes') ); ?>"><?php _e( 'Edit', 'woocommerce' ); ?></a> | </span><span class="delete"><a class="delete" href="<?php echo esc_url( wp_nonce_url( add_query_arg('delete', $tax->attribute_id, 'admin.php?page=product_attributes'), 'woocommerce-delete-attribute_' . $tax->attribute_id ) ); ?>"><?php _e( 'Delete', 'woocommerce' ); ?></a></span></div>
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo esc_html( $tax->attribute_name ); ?></td>
|
<td><?php echo esc_html( $tax->attribute_name ); ?></td>
|
||||||
<td><?php echo esc_html( ucwords( $tax->attribute_type ) ); ?></td>
|
<td><?php echo esc_html( ucwords( $tax->attribute_type ) ); ?></td>
|
||||||
|
@ -370,7 +370,7 @@ class WC_Admin_Attributes {
|
||||||
<div class="form-wrap">
|
<div class="form-wrap">
|
||||||
<h3><?php _e( 'Add New Attribute', 'woocommerce' ) ?></h3>
|
<h3><?php _e( 'Add New Attribute', 'woocommerce' ) ?></h3>
|
||||||
<p><?php _e( 'Attributes let you define extra product data, such as size or colour. You can use these attributes in the shop sidebar using the "layered nav" widgets. Please note: you cannot rename an attribute later on.', 'woocommerce' ) ?></p>
|
<p><?php _e( 'Attributes let you define extra product data, such as size or colour. You can use these attributes in the shop sidebar using the "layered nav" widgets. Please note: you cannot rename an attribute later on.', 'woocommerce' ) ?></p>
|
||||||
<form action="admin.php?page=woocommerce_attributes" method="post">
|
<form action="admin.php?page=product_attributes" method="post">
|
||||||
<div class="form-field">
|
<div class="form-field">
|
||||||
<label for="attribute_label"><?php _e( 'Name', 'woocommerce' ); ?></label>
|
<label for="attribute_label"><?php _e( 'Name', 'woocommerce' ); ?></label>
|
||||||
<input name="attribute_label" id="attribute_label" type="text" value="" />
|
<input name="attribute_label" id="attribute_label" type="text" value="" />
|
||||||
|
|
|
@ -126,14 +126,14 @@ class WC_Admin_Dashboard {
|
||||||
?>
|
?>
|
||||||
<ul class="wc_status_list">
|
<ul class="wc_status_list">
|
||||||
<li class="sales-this-month">
|
<li class="sales-this-month">
|
||||||
<a href="<?php echo admin_url( 'admin.php?page=wc_reports&tab=orders&range=month' ); ?>">
|
<a href="<?php echo admin_url( 'admin.php?page=wc-reports&tab=orders&range=month' ); ?>">
|
||||||
<?php echo $reports->sales_sparkline( '', max( 7, date( 'd', current_time('timestamp') ) ) ); ?>
|
<?php echo $reports->sales_sparkline( '', max( 7, date( 'd', current_time('timestamp') ) ) ); ?>
|
||||||
<?php printf( __( "<strong>%s</strong> sales this month", 'woocommerce' ), woocommerce_price( $sales ) ); ?>
|
<?php printf( __( "<strong>%s</strong> sales this month", 'woocommerce' ), woocommerce_price( $sales ) ); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if ( $top_seller && $top_seller->qty ) : ?>
|
<?php if ( $top_seller && $top_seller->qty ) : ?>
|
||||||
<li class="best-seller-this-month">
|
<li class="best-seller-this-month">
|
||||||
<a href="<?php echo admin_url( 'admin.php?page=wc_reports&tab=orders&report=sales_by_product&range=month&product_ids=' . $top_seller->product_id ); ?>">
|
<a href="<?php echo admin_url( 'admin.php?page=wc-reports&tab=orders&report=sales_by_product&range=month&product_ids=' . $top_seller->product_id ); ?>">
|
||||||
<?php echo $reports->sales_sparkline( $top_seller->product_id, max( 7, date( 'd', current_time('timestamp') ) ), 'count' ); ?>
|
<?php echo $reports->sales_sparkline( $top_seller->product_id, max( 7, date( 'd', current_time('timestamp') ) ), 'count' ); ?>
|
||||||
<?php printf( __( "%s top seller this month (sold %d)", 'woocommerce' ), "<strong>" . get_the_title( $top_seller->product_id ) . "</strong>", $top_seller->qty ); ?>
|
<?php printf( __( "%s top seller this month (sold %d)", 'woocommerce' ), "<strong>" . get_the_title( $top_seller->product_id ) . "</strong>", $top_seller->qty ); ?>
|
||||||
</a>
|
</a>
|
||||||
|
@ -150,12 +150,12 @@ class WC_Admin_Dashboard {
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="low-in-stock">
|
<li class="low-in-stock">
|
||||||
<a href="<?php echo admin_url( 'admin.php?page=wc_reports&tab=stock&report=low_in_stock' ); ?>">
|
<a href="<?php echo admin_url( 'admin.php?page=wc-reports&tab=stock&report=low_in_stock' ); ?>">
|
||||||
<?php printf( _n( "<strong>%s product</strong> low in stock", "<strong>%s products</strong> are low in stock", $lowinstock_count, 'woocommerce' ), $lowinstock_count ); ?>
|
<?php printf( _n( "<strong>%s product</strong> low in stock", "<strong>%s products</strong> are low in stock", $lowinstock_count, 'woocommerce' ), $lowinstock_count ); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="out-of-stock">
|
<li class="out-of-stock">
|
||||||
<a href="<?php echo admin_url( 'admin.php?page=wc_reports&tab=stock&report=out_of_stock' ); ?>">
|
<a href="<?php echo admin_url( 'admin.php?page=wc-reports&tab=stock&report=out_of_stock' ); ?>">
|
||||||
<?php printf( _n( "<strong>%s product</strong> out of stock", "<strong>%s products</strong> are out of stock", $outofstock_count, 'woocommerce' ), $outofstock_count ); ?>
|
<?php printf( _n( "<strong>%s product</strong> out of stock", "<strong>%s products</strong> are out of stock", $outofstock_count, 'woocommerce' ), $outofstock_count ); ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -53,7 +53,7 @@ class WC_Admin_Help {
|
||||||
|
|
||||||
'<p>' . __( 'Before asking for help we recommend checking the status page to identify any problems with your configuration.', 'woocommerce' ) . '</p>' .
|
'<p>' . __( 'Before asking for help we recommend checking the status page to identify any problems with your configuration.', 'woocommerce' ) . '</p>' .
|
||||||
|
|
||||||
'<p><a href="' . admin_url('admin.php?page=wc_status') . '" class="button button-primary">' . __( 'System Status', 'woocommerce' ) . '</a> <a href="' . 'http://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'Community Support', 'woocommerce' ) . '</a> <a href="' . 'http://support.woothemes.com' . '" class="button">' . __( 'Customer Support', 'woocommerce' ) . '</a></p>'
|
'<p><a href="' . admin_url('admin.php?page=wc-status') . '" class="button button-primary">' . __( 'System Status', 'woocommerce' ) . '</a> <a href="' . 'http://wordpress.org/support/plugin/woocommerce' . '" class="button">' . __( 'Community Support', 'woocommerce' ) . '</a> <a href="' . 'http://support.woothemes.com' . '" class="button">' . __( 'Customer Support', 'woocommerce' ) . '</a></p>'
|
||||||
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
@ -62,9 +62,9 @@ class WC_Admin_Help {
|
||||||
'title' => __( 'Found a bug?', 'woocommerce' ),
|
'title' => __( 'Found a bug?', 'woocommerce' ),
|
||||||
'content' =>
|
'content' =>
|
||||||
|
|
||||||
'<p>' . sprintf(__( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%s">Github issues</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. Be as descriptive as possible and please include your <a href="%s">system status report</a>.', 'woocommerce' ), 'https://github.com/woothemes/woocommerce/issues?state=open', 'https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md', admin_url( 'admin.php?page=wc_status' ) ) . '</p>' .
|
'<p>' . sprintf(__( 'If you find a bug within WooCommerce core you can create a ticket via <a href="%s">Github issues</a>. Ensure you read the <a href="%s">contribution guide</a> prior to submitting your report. Be as descriptive as possible and please include your <a href="%s">system status report</a>.', 'woocommerce' ), 'https://github.com/woothemes/woocommerce/issues?state=open', 'https://github.com/woothemes/woocommerce/blob/master/CONTRIBUTING.md', admin_url( 'admin.php?page=wc-status' ) ) . '</p>' .
|
||||||
|
|
||||||
'<p><a href="https://github.com/woothemes/woocommerce/issues?state=open" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url('admin.php?page=wc_status') . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>'
|
'<p><a href="https://github.com/woothemes/woocommerce/issues?state=open" class="button button-primary">' . __( 'Report a bug', 'woocommerce' ) . '</a> <a href="' . admin_url('admin.php?page=wc-status') . '" class="button">' . __( 'System Status', 'woocommerce' ) . '</a></p>'
|
||||||
|
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
|
|
@ -46,21 +46,21 @@ class WC_Admin_Menus {
|
||||||
|
|
||||||
$main_page = add_menu_page( __( 'WooCommerce', 'woocommerce' ), __( 'WooCommerce', 'woocommerce' ), 'manage_woocommerce', 'woocommerce' , array( $this, 'settings_page' ), null, '55.5' );
|
$main_page = add_menu_page( __( 'WooCommerce', 'woocommerce' ), __( 'WooCommerce', 'woocommerce' ), 'manage_woocommerce', 'woocommerce' , array( $this, 'settings_page' ), null, '55.5' );
|
||||||
|
|
||||||
add_submenu_page( 'edit.php?post_type=product', __( 'Attributes', 'woocommerce' ), __( 'Attributes', 'woocommerce' ), 'manage_product_terms', 'woocommerce_attributes', array( $this, 'attributes_page' ) );
|
add_submenu_page( 'edit.php?post_type=product', __( 'Attributes', 'woocommerce' ), __( 'Attributes', 'woocommerce' ), 'manage_product_terms', 'product_attributes', array( $this, 'attributes_page' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add menu item
|
* Add menu item
|
||||||
*/
|
*/
|
||||||
public function reports_menu() {
|
public function reports_menu() {
|
||||||
add_submenu_page( 'woocommerce', __( 'Reports', 'woocommerce' ), __( 'Reports', 'woocommerce' ) , 'view_woocommerce_reports', 'wc_reports', array( $this, 'reports_page' ) );
|
add_submenu_page( 'woocommerce', __( 'Reports', 'woocommerce' ), __( 'Reports', 'woocommerce' ) , 'view_woocommerce_reports', 'wc-reports', array( $this, 'reports_page' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add menu item
|
* Add menu item
|
||||||
*/
|
*/
|
||||||
public function settings_menu() {
|
public function settings_menu() {
|
||||||
$settings_page = add_submenu_page( 'woocommerce', __( 'WooCommerce Settings', 'woocommerce' ), __( 'Settings', 'woocommerce' ) , 'manage_woocommerce', 'woocommerce_settings', array( $this, 'settings_page' ) );
|
$settings_page = add_submenu_page( 'woocommerce', __( 'WooCommerce Settings', 'woocommerce' ), __( 'Settings', 'woocommerce' ) , 'manage_woocommerce', 'wc-settings', array( $this, 'settings_page' ) );
|
||||||
|
|
||||||
add_action( 'load-' . $settings_page, array( $this, 'settings_page_init' ) );
|
add_action( 'load-' . $settings_page, array( $this, 'settings_page_init' ) );
|
||||||
}
|
}
|
||||||
|
@ -77,14 +77,14 @@ class WC_Admin_Menus {
|
||||||
* Add menu item
|
* Add menu item
|
||||||
*/
|
*/
|
||||||
public function status_menu() {
|
public function status_menu() {
|
||||||
add_submenu_page( 'woocommerce', __( 'WooCommerce Status', 'woocommerce' ), __( 'System Status', 'woocommerce' ) , 'manage_woocommerce', 'wc_status', array( $this, 'status_page' ) );
|
add_submenu_page( 'woocommerce', __( 'WooCommerce Status', 'woocommerce' ), __( 'System Status', 'woocommerce' ) , 'manage_woocommerce', 'wc-status', array( $this, 'status_page' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Addons menu item
|
* Addons menu item
|
||||||
*/
|
*/
|
||||||
public function addons_menu() {
|
public function addons_menu() {
|
||||||
add_submenu_page( 'woocommerce', __( 'WooCommerce Add-ons/Extensions', 'woocommerce' ), __( 'Add-ons', 'woocommerce' ) , 'manage_woocommerce', 'wc_addons', array( $this, 'addons_page' ) );
|
add_submenu_page( 'woocommerce', __( 'WooCommerce Add-ons/Extensions', 'woocommerce' ), __( 'Add-ons', 'woocommerce' ) , 'manage_woocommerce', 'wc-addons', array( $this, 'addons_page' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,7 +108,7 @@ class WC_Admin_Menus {
|
||||||
$screen = get_current_screen();
|
$screen = get_current_screen();
|
||||||
|
|
||||||
if ( $screen->base == 'edit-tags' && taxonomy_is_product_attribute( $taxonomy ) ) {
|
if ( $screen->base == 'edit-tags' && taxonomy_is_product_attribute( $taxonomy ) ) {
|
||||||
$submenu_file = 'woocommerce_attributes';
|
$submenu_file = 'product_attributes';
|
||||||
$parent_file = 'edit.php?post_type=' . esc_attr( $post_type );
|
$parent_file = 'edit.php?post_type=' . esc_attr( $post_type );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,8 +150,8 @@ class WC_Admin_Welcome {
|
||||||
<div class="wc-badge"><?php printf( __( 'Version %s', 'woocommerce' ), $woocommerce->version ); ?></div>
|
<div class="wc-badge"><?php printf( __( 'Version %s', 'woocommerce' ), $woocommerce->version ); ?></div>
|
||||||
|
|
||||||
<p class="woocommerce-actions">
|
<p class="woocommerce-actions">
|
||||||
<a href="<?php echo admin_url('admin.php?page=woocommerce_settings'); ?>" class="button button-primary"><?php _e( 'Settings', 'woocommerce' ); ?></a>
|
<a href="<?php echo admin_url('admin.php?page=wc-settings'); ?>" class="button button-primary"><?php _e( 'Settings', 'woocommerce' ); ?></a>
|
||||||
<a class="docs button button-primary" href="http://docs.woothemes.com/documentation/plugins/woocommerce/"><?php _e( 'Docs', 'woocommerce' ); ?></a>
|
<a class="docs button button-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/documentation/plugins/woocommerce/', 'woocommerce' ) ); ?>"><?php _e( 'Docs', 'woocommerce' ); ?></a>
|
||||||
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully." data-via="WooThemes" data-size="large" data-hashtags="WooCommerce">Tweet</a>
|
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.woothemes.com/woocommerce/" data-text="A open-source (free) #ecommerce plugin for #WordPress that helps you sell anything. Beautifully." data-via="WooThemes" data-size="large" data-hashtags="WooCommerce">Tweet</a>
|
||||||
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
|
||||||
</p>
|
</p>
|
||||||
|
@ -316,7 +316,7 @@ class WC_Admin_Welcome {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="return-to-dashboard">
|
<div class="return-to-dashboard">
|
||||||
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'woocommerce_settings' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to WooCommerce Settings', 'woocommerce' ); ?></a>
|
<a href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'wc-settings' ), 'admin.php' ) ) ); ?>"><?php _e( 'Go to WooCommerce Settings', 'woocommerce' ); ?></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -38,7 +38,6 @@ class WC_Admin {
|
||||||
include( 'wc-meta-box-functions.php' );
|
include( 'wc-meta-box-functions.php' );
|
||||||
|
|
||||||
// Classes
|
// Classes
|
||||||
include( 'class-wc-admin-help.php' );
|
|
||||||
include( 'class-wc-admin-menus.php' );
|
include( 'class-wc-admin-menus.php' );
|
||||||
include( 'class-wc-admin-welcome.php' );
|
include( 'class-wc-admin-welcome.php' );
|
||||||
include( 'class-wc-admin-notices.php' );
|
include( 'class-wc-admin-notices.php' );
|
||||||
|
@ -48,6 +47,10 @@ class WC_Admin {
|
||||||
include( 'class-wc-admin-taxonomies.php' );
|
include( 'class-wc-admin-taxonomies.php' );
|
||||||
include( 'class-wc-admin-editor.php' );
|
include( 'class-wc-admin-editor.php' );
|
||||||
|
|
||||||
|
// Help
|
||||||
|
if ( apply_filters( 'woocommerce_enable_admin_help_tab', true ) )
|
||||||
|
include( 'class-wc-admin-help.php' );
|
||||||
|
|
||||||
// Importers
|
// Importers
|
||||||
if ( defined( 'WP_LOAD_IMPORTERS' ) )
|
if ( defined( 'WP_LOAD_IMPORTERS' ) )
|
||||||
include( 'class-wc-admin-importers.php' );
|
include( 'class-wc-admin-importers.php' );
|
||||||
|
|
|
@ -209,7 +209,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||||
* Performs post-import cleanup of files and the cache
|
* Performs post-import cleanup of files and the cache
|
||||||
*/
|
*/
|
||||||
function import_end() {
|
function import_end() {
|
||||||
echo '<p>' . __( 'All done!', 'woocommerce' ) . ' <a href="' . admin_url('admin.php?page=woocommerce_settings&tab=tax') . '">' . __( 'View Tax Rates', 'woocommerce' ) . '</a>' . '</p>';
|
echo '<p>' . __( 'All done!', 'woocommerce' ) . ' <a href="' . admin_url('admin.php?page=wc-settings&tab=tax') . '">' . __( 'View Tax Rates', 'woocommerce' ) . '</a>' . '</p>';
|
||||||
|
|
||||||
do_action( 'import_end' );
|
do_action( 'import_end' );
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ class WC_Meta_Box_Coupon_Data {
|
||||||
woocommerce_wp_text_input( array( 'id' => 'coupon_amount', 'label' => __( 'Coupon amount', 'woocommerce' ), 'placeholder' => '0.00', 'description' => __( 'Value of the coupon.', 'woocommerce' ), 'class' => 'wc_input_decimal', 'desc_tip' => true ) );
|
woocommerce_wp_text_input( array( 'id' => 'coupon_amount', 'label' => __( 'Coupon amount', 'woocommerce' ), 'placeholder' => '0.00', 'description' => __( 'Value of the coupon.', 'woocommerce' ), 'class' => 'wc_input_decimal', 'desc_tip' => true ) );
|
||||||
|
|
||||||
// Free Shipping
|
// Free Shipping
|
||||||
woocommerce_wp_checkbox( array( 'id' => 'free_shipping', 'label' => __( 'Allow free shipping', 'woocommerce' ), 'description' => sprintf(__( 'Check this box if the coupon grants free shipping. The <a href="%s">free shipping method</a> must be enabled with the "must use coupon" setting.', 'woocommerce' ), admin_url('admin.php?page=woocommerce_settings&tab=shipping§ion=WC_Shipping_Free_Shipping')) ) );
|
woocommerce_wp_checkbox( array( 'id' => 'free_shipping', 'label' => __( 'Allow free shipping', 'woocommerce' ), 'description' => sprintf(__( 'Check this box if the coupon grants free shipping. The <a href="%s">free shipping method</a> must be enabled with the "must use coupon" setting.', 'woocommerce' ), admin_url('admin.php?page=wc-settings&tab=shipping§ion=WC_Shipping_Free_Shipping')) ) );
|
||||||
|
|
||||||
// Apply before tax
|
// Apply before tax
|
||||||
woocommerce_wp_checkbox( array( 'id' => 'apply_before_tax', 'label' => __( 'Apply before tax', 'woocommerce' ), 'description' => __( 'Check this box if the coupon should be applied before calculating cart tax.', 'woocommerce' ) ) );
|
woocommerce_wp_checkbox( array( 'id' => 'apply_before_tax', 'label' => __( 'Apply before tax', 'woocommerce' ), 'description' => __( 'Check this box if the coupon should be applied before calculating cart tax.', 'woocommerce' ) ) );
|
||||||
|
|
|
@ -102,7 +102,7 @@ class WC_Meta_Box_Product_Data {
|
||||||
),
|
),
|
||||||
'attribute' => array(
|
'attribute' => array(
|
||||||
'label' => __( 'Attributes', 'woocommerce' ),
|
'label' => __( 'Attributes', 'woocommerce' ),
|
||||||
'target' => 'woocommerce_attributes',
|
'target' => 'product_attributes',
|
||||||
'class' => array(),
|
'class' => array(),
|
||||||
),
|
),
|
||||||
'variations' => array(
|
'variations' => array(
|
||||||
|
@ -383,13 +383,13 @@ class WC_Meta_Box_Product_Data {
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="woocommerce_attributes" class="panel wc-metaboxes-wrapper">
|
<div id="product_attributes" class="panel wc-metaboxes-wrapper">
|
||||||
|
|
||||||
<p class="toolbar">
|
<p class="toolbar">
|
||||||
<a href="#" class="close_all"><?php _e( 'Close all', 'woocommerce' ); ?></a><a href="#" class="expand_all"><?php _e( 'Expand all', 'woocommerce' ); ?></a>
|
<a href="#" class="close_all"><?php _e( 'Close all', 'woocommerce' ); ?></a><a href="#" class="expand_all"><?php _e( 'Expand all', 'woocommerce' ); ?></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="woocommerce_attributes wc-metaboxes">
|
<div class="product_attributes wc-metaboxes">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// Array of defined attribute taxonomies
|
// Array of defined attribute taxonomies
|
||||||
|
@ -743,7 +743,7 @@ class WC_Meta_Box_Product_Data {
|
||||||
<div class="squeezer">
|
<div class="squeezer">
|
||||||
<h4><?php _e( 'Before adding variations, add and save some attributes on the <strong>Attributes</strong> tab.', 'woocommerce' ); ?></h4>
|
<h4><?php _e( 'Before adding variations, add and save some attributes on the <strong>Attributes</strong> tab.', 'woocommerce' ); ?></h4>
|
||||||
|
|
||||||
<p class="submit"><a class="button-primary" href="http://docs.woothemes.com/document/product-variations/" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
<p class="submit"><a class="button-primary" href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/document/product-variations', 'product-variations' ) ); ?>" target="_blank"><?php _e( 'Learn more', 'woocommerce' ); ?></a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ class WC_Settings_Accounts extends WC_Settings_Page {
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'My Account Page', 'woocommerce' ),
|
'title' => __( 'My Account Page', 'woocommerce' ),
|
||||||
'desc' => __( 'Page contents: [woocommerce_my_account]', 'woocommerce' ),
|
'desc' => __( 'Page contents:', 'woocommerce' ) . ' [' . apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) . ']',
|
||||||
'id' => 'woocommerce_myaccount_page_id',
|
'id' => 'woocommerce_myaccount_page_id',
|
||||||
'type' => 'single_select_page',
|
'type' => 'single_select_page',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
|
|
|
@ -110,7 +110,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Cart Page', 'woocommerce' ),
|
'title' => __( 'Cart Page', 'woocommerce' ),
|
||||||
'desc' => __( 'Page contents: [woocommerce_cart]', 'woocommerce' ),
|
'desc' => __( 'Page contents:', 'woocommerce' ) . ' [' . apply_filters( 'woocommerce_cart_shortcode_tag', 'woocommerce_cart' ) . ']',
|
||||||
'id' => 'woocommerce_cart_page_id',
|
'id' => 'woocommerce_cart_page_id',
|
||||||
'type' => 'single_select_page',
|
'type' => 'single_select_page',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
|
@ -121,7 +121,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Checkout Page', 'woocommerce' ),
|
'title' => __( 'Checkout Page', 'woocommerce' ),
|
||||||
'desc' => __( 'Page contents: [woocommerce_checkout]', 'woocommerce' ),
|
'desc' => __( 'Page contents:', 'woocommerce' ) . ' [' . apply_filters( 'woocommerce_checkout_shortcode_tag', 'woocommerce_checkout' ) . ']',
|
||||||
'id' => 'woocommerce_checkout_page_id',
|
'id' => 'woocommerce_checkout_page_id',
|
||||||
'type' => 'single_select_page',
|
'type' => 'single_select_page',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
|
@ -265,7 +265,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page {
|
||||||
break;
|
break;
|
||||||
case 'settings' :
|
case 'settings' :
|
||||||
echo '<td class="settings">
|
echo '<td class="settings">
|
||||||
<a class="button" href="' . admin_url( 'admin.php?page=woocommerce_settings&tab=checkout§ion=' . strtolower( get_class( $gateway ) ) ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>
|
<a class="button" href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=' . strtolower( get_class( $gateway ) ) ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>
|
||||||
</td>';
|
</td>';
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
|
|
|
@ -63,7 +63,7 @@ class WC_Settings_Page {
|
||||||
$array_keys = array_keys( $sections );
|
$array_keys = array_keys( $sections );
|
||||||
|
|
||||||
foreach ( $sections as $id => $label )
|
foreach ( $sections as $id => $label )
|
||||||
echo '<li><a href="' . admin_url( 'admin.php?page=woocommerce_settings&tab=' . $this->id . '§ion=' . sanitize_title( $id ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';
|
echo '<li><a href="' . admin_url( 'admin.php?page=wc-settings&tab=' . $this->id . '§ion=' . sanitize_title( $id ) ) . '" class="' . ( $current_section == $id ? 'current' : '' ) . '">' . $label . '</a> ' . ( end( $array_keys ) == $id ? '' : '|' ) . ' </li>';
|
||||||
|
|
||||||
echo '</ul><br class="clear" />';
|
echo '</ul><br class="clear" />';
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Restrict shipping to Location(s)', 'woocommerce' ),
|
'title' => __( 'Restrict shipping to Location(s)', 'woocommerce' ),
|
||||||
'desc' => sprintf( __( 'Choose which countries you want to ship to, or choose to ship to all <a href="%s">locations you sell to</a>.', 'woocommerce' ), admin_url( 'admin.php?page=woocommerce_settings&tab=general' ) ),
|
'desc' => sprintf( __( 'Choose which countries you want to ship to, or choose to ship to all <a href="%s">locations you sell to</a>.', 'woocommerce' ), admin_url( 'admin.php?page=wc-settings&tab=general' ) ),
|
||||||
'id' => 'woocommerce_ship_to_countries',
|
'id' => 'woocommerce_ship_to_countries',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
|
@ -238,7 +238,7 @@ class WC_Settings_Shipping extends WC_Settings_Page {
|
||||||
|
|
||||||
echo '</td>
|
echo '</td>
|
||||||
<td class="settings">
|
<td class="settings">
|
||||||
<a class="button" href="' . admin_url( 'admin.php?page=woocommerce_settings&tab=shipping§ion=' . strtolower( get_class( $method ) ) ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>
|
<a class="button" href="' . admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=' . strtolower( get_class( $method ) ) ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
foreach ( $links as $link => $name ) {
|
foreach ( $links as $link => $name ) {
|
||||||
$i ++;
|
$i ++;
|
||||||
?><li><a class="<?php if ( $view == $link ) echo 'current'; ?>" href="<?php echo admin_url( 'admin.php?page=wc_addons&view=' . esc_attr( $link ) ); ?>"><?php echo $name; ?></a><?php if ( $i != sizeof( $links ) ) echo ' |'; ?></li><?php
|
?><li><a class="<?php if ( $view == $link ) echo 'current'; ?>" href="<?php echo admin_url( 'admin.php?page=wc-addons&view=' . esc_attr( $link ) ); ?>"><?php echo $name; ?></a><?php if ( $i != sizeof( $links ) ) echo ' |'; ?></li><?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="icon32 icon32-woocommerce-reports" id="icon-woocommerce"><br /></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
<div class="icon32 icon32-woocommerce-reports" id="icon-woocommerce"><br /></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||||
<?php
|
<?php
|
||||||
foreach ( $reports as $key => $report_group ) {
|
foreach ( $reports as $key => $report_group ) {
|
||||||
echo '<a href="'.admin_url( 'admin.php?page=wc_reports&tab=' . urlencode( $key ) ).'" class="nav-tab ';
|
echo '<a href="'.admin_url( 'admin.php?page=wc-reports&tab=' . urlencode( $key ) ).'" class="nav-tab ';
|
||||||
if ( $current_tab == $key ) echo 'nav-tab-active';
|
if ( $current_tab == $key ) echo 'nav-tab-active';
|
||||||
echo '">' . esc_html( $report_group[ 'title' ] ) . '</a>';
|
echo '">' . esc_html( $report_group[ 'title' ] ) . '</a>';
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
foreach ( $reports[ $current_tab ]['reports'] as $key => $report ) {
|
foreach ( $reports[ $current_tab ]['reports'] as $key => $report ) {
|
||||||
|
|
||||||
$link = '<a href="admin.php?page=wc_reports&tab=' . urlencode( $current_tab ) . '&report=' . urlencode( $key ) . '" class="';
|
$link = '<a href="admin.php?page=wc-reports&tab=' . urlencode( $current_tab ) . '&report=' . urlencode( $key ) . '" class="';
|
||||||
|
|
||||||
if ( $key == $current_report ) $link .= 'current';
|
if ( $key == $current_report ) $link .= 'current';
|
||||||
|
|
||||||
|
|
|
@ -287,15 +287,15 @@
|
||||||
),
|
),
|
||||||
__( 'Cart', 'woocommerce' ) => array(
|
__( 'Cart', 'woocommerce' ) => array(
|
||||||
'option' => 'woocommerce_cart_page_id',
|
'option' => 'woocommerce_cart_page_id',
|
||||||
'shortcode' => '[woocommerce_cart]'
|
'shortcode' => '[' . apply_filters( 'woocommerce_cart_shortcode_tag', 'woocommerce_cart' ) . ']'
|
||||||
),
|
),
|
||||||
__( 'Checkout', 'woocommerce' ) => array(
|
__( 'Checkout', 'woocommerce' ) => array(
|
||||||
'option' => 'woocommerce_checkout_page_id',
|
'option' => 'woocommerce_checkout_page_id',
|
||||||
'shortcode' => '[woocommerce_checkout]'
|
'shortcode' => '[' . apply_filters( 'woocommerce_checkout_shortcode_tag', 'woocommerce_checkout' ) . ']'
|
||||||
),
|
),
|
||||||
__( 'My Account', 'woocommerce' ) => array(
|
__( 'My Account', 'woocommerce' ) => array(
|
||||||
'option' => 'woocommerce_myaccount_page_id',
|
'option' => 'woocommerce_myaccount_page_id',
|
||||||
'shortcode' => '[woocommerce_my_account]'
|
'shortcode' => '[' . apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) . ']'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<td><?php echo esc_html( $tool['name'] ); ?></td>
|
<td><?php echo esc_html( $tool['name'] ); ?></td>
|
||||||
<td>
|
<td>
|
||||||
<p>
|
<p>
|
||||||
<a href="<?php echo wp_nonce_url( admin_url('admin.php?page=wc_status&tab=tools&action=' . $action ), 'debug_action' ); ?>" class="button"><?php echo esc_html( $tool['button'] ); ?></a>
|
<a href="<?php echo wp_nonce_url( admin_url('admin.php?page=wc-status&tab=tools&action=' . $action ), 'debug_action' ); ?>" class="button"><?php echo esc_html( $tool['button'] ); ?></a>
|
||||||
<span class="description"><?php echo wp_kses_post( $tool['desc'] ); ?></span>
|
<span class="description"><?php echo wp_kses_post( $tool['desc'] ); ?></span>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
'tools' => __( 'Tools', 'woocommerce' ),
|
'tools' => __( 'Tools', 'woocommerce' ),
|
||||||
);
|
);
|
||||||
foreach ( $tabs as $name => $label ) {
|
foreach ( $tabs as $name => $label ) {
|
||||||
echo '<a href="' . admin_url( 'admin.php?page=wc_status&tab=' . $name ) . '" class="nav-tab ';
|
echo '<a href="' . admin_url( 'admin.php?page=wc-status&tab=' . $name ) . '" class="nav-tab ';
|
||||||
if ( $current_tab == $name ) echo 'nav-tab-active';
|
if ( $current_tab == $name ) echo 'nav-tab-active';
|
||||||
echo '">' . $label . '</a>';
|
echo '">' . $label . '</a>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="icon32 icon32-woocommerce-settings" id="icon-woocommerce"><br /></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
<div class="icon32 icon32-woocommerce-settings" id="icon-woocommerce"><br /></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
||||||
<?php
|
<?php
|
||||||
foreach ( $tabs as $name => $label )
|
foreach ( $tabs as $name => $label )
|
||||||
echo '<a href="' . admin_url( 'admin.php?page=woocommerce_settings&tab=' . $name ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
|
echo '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=' . $name ) . '" class="nav-tab ' . ( $current_tab == $name ? 'nav-tab-active' : '' ) . '">' . $label . '</a>';
|
||||||
|
|
||||||
do_action( 'woocommerce_settings_tabs' );
|
do_action( 'woocommerce_settings_tabs' );
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -4,6 +4,6 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
<div id="message" class="updated woocommerce-message wc-connect">
|
<div id="message" class="updated woocommerce-message wc-connect">
|
||||||
<div class="squeezer">
|
<div class="squeezer">
|
||||||
<h4><?php _e( '<strong>Welcome to WooCommerce</strong> – You\'re almost ready to start selling :)', 'woocommerce' ); ?></h4>
|
<h4><?php _e( '<strong>Welcome to WooCommerce</strong> – You\'re almost ready to start selling :)', 'woocommerce' ); ?></h4>
|
||||||
<p class="submit"><a href="<?php echo add_query_arg('install_woocommerce_pages', 'true', admin_url('admin.php?page=woocommerce_settings') ); ?>" class="button-primary"><?php _e( 'Install WooCommerce Pages', 'woocommerce' ); ?></a> <a class="skip button-primary" href="<?php echo add_query_arg('skip_install_woocommerce_pages', 'true', admin_url('admin.php?page=woocommerce_settings') ); ?>"><?php _e( 'Skip setup', 'woocommerce' ); ?></a></p>
|
<p class="submit"><a href="<?php echo add_query_arg('install_woocommerce_pages', 'true', admin_url('admin.php?page=wc-settings') ); ?>" class="button-primary"><?php _e( 'Install WooCommerce Pages', 'woocommerce' ); ?></a> <a class="skip button-primary" href="<?php echo add_query_arg('skip_install_woocommerce_pages', 'true', admin_url('admin.php?page=wc-settings') ); ?>"><?php _e( 'Skip setup', 'woocommerce' ); ?></a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -4,6 +4,6 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
<div id="message" class="updated woocommerce-message wc-connect">
|
<div id="message" class="updated woocommerce-message wc-connect">
|
||||||
<div class="squeezer">
|
<div class="squeezer">
|
||||||
<h4><?php _e( '<strong>Your theme does not declare WooCommerce support</strong> – if you encounter layout issues please read our integration guide or choose a WooCommerce theme :)', 'woocommerce' ); ?></h4>
|
<h4><?php _e( '<strong>Your theme does not declare WooCommerce support</strong> – if you encounter layout issues please read our integration guide or choose a WooCommerce theme :)', 'woocommerce' ); ?></h4>
|
||||||
<p class="submit"><a href="http://docs.woothemes.com/document/third-party-custom-theme-compatibility/" class="button-primary"><?php _e( 'Theme Integration Guide', 'woocommerce' ); ?></a> <a class="skip button-primary" href="<?php echo add_query_arg( 'hide_woocommerce_theme_support_check', 'true' ); ?>"><?php _e( 'Hide this notice', 'woocommerce' ); ?></a></p>
|
<p class="submit"><a href="<?php echo esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/document/third-party-custom-theme-compatibility/', 'theme-compatibility' ) ); ?>" class="button-primary"><?php _e( 'Theme Integration Guide', 'woocommerce' ); ?></a> <a class="skip button-primary" href="<?php echo esc_url( add_query_arg( 'hide_woocommerce_theme_support_check', 'true' ) ); ?>"><?php _e( 'Hide this notice', 'woocommerce' ); ?></a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
<div id="message" class="updated woocommerce-message wc-connect">
|
<div id="message" class="updated woocommerce-message wc-connect">
|
||||||
<div class="squeezer">
|
<div class="squeezer">
|
||||||
<h4><?php _e( '<strong>WooCommerce Data Update Required</strong> – We just need to update your install to the latest version', 'woocommerce' ); ?></h4>
|
<h4><?php _e( '<strong>WooCommerce Data Update Required</strong> – We just need to update your install to the latest version', 'woocommerce' ); ?></h4>
|
||||||
<p class="submit"><a href="<?php echo add_query_arg( 'do_update_woocommerce', 'true', admin_url('admin.php?page=woocommerce_settings') ); ?>" class="wc-update-now button-primary"><?php _e( 'Run the updater', 'woocommerce' ); ?></a></p>
|
<p class="submit"><a href="<?php echo add_query_arg( 'do_update_woocommerce', 'true', admin_url('admin.php?page=wc-settings') ); ?>" class="wc-update-now button-primary"><?php _e( 'Run the updater', 'woocommerce' ); ?></a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -20,16 +20,11 @@ function wc_get_screen_ids() {
|
||||||
|
|
||||||
return apply_filters( 'woocommerce_screen_ids', array(
|
return apply_filters( 'woocommerce_screen_ids', array(
|
||||||
'toplevel_page_' . $wc_screen_id,
|
'toplevel_page_' . $wc_screen_id,
|
||||||
$wc_screen_id . '_page_wc_reports',
|
$wc_screen_id . '_page_wc-reports',
|
||||||
$wc_screen_id . '_page_wc_status',
|
$wc_screen_id . '_page_wc-settings',
|
||||||
$wc_screen_id . '_page_woocommerce_settings',
|
$wc_screen_id . '_page_wc-status',
|
||||||
$wc_screen_id . '_page_wc_status',
|
$wc_screen_id . '_page_wc-addons',
|
||||||
$wc_screen_id . '_page_wc_addons',
|
'product_page_product_attributes',
|
||||||
$wc_screen_id . '_page_woocommerce_customers',
|
|
||||||
'toplevel_page_woocommerce',
|
|
||||||
'woocommerce_page_woocommerce_settings',
|
|
||||||
'woocommerce_page_wc_status',
|
|
||||||
'product_page_woocommerce_attributes',
|
|
||||||
'edit-shop_order',
|
'edit-shop_order',
|
||||||
'shop_order',
|
'shop_order',
|
||||||
'edit-product',
|
'edit-product',
|
||||||
|
|
|
@ -213,17 +213,17 @@ class WC_Install {
|
||||||
'cart' => array(
|
'cart' => array(
|
||||||
'name' => _x( 'cart', 'page_slug', 'woocommerce' ),
|
'name' => _x( 'cart', 'page_slug', 'woocommerce' ),
|
||||||
'title' => __( 'Cart', 'woocommerce' ),
|
'title' => __( 'Cart', 'woocommerce' ),
|
||||||
'content' => '[woocommerce_cart]'
|
'content' => '[' . apply_filters( 'woocommerce_cart_shortcode_tag', 'woocommerce_cart' ) . ']'
|
||||||
),
|
),
|
||||||
'checkout' => array(
|
'checkout' => array(
|
||||||
'name' => _x( 'checkout', 'page_slug', 'woocommerce' ),
|
'name' => _x( 'checkout', 'page_slug', 'woocommerce' ),
|
||||||
'title' => __( 'Checkout', 'woocommerce' ),
|
'title' => __( 'Checkout', 'woocommerce' ),
|
||||||
'content' => '[woocommerce_checkout]'
|
'content' => '[' . apply_filters( 'woocommerce_checkout_shortcode_tag', 'woocommerce_checkout' ) . ']'
|
||||||
),
|
),
|
||||||
'myaccount' => array(
|
'myaccount' => array(
|
||||||
'name' => _x( 'my-account', 'page_slug', 'woocommerce' ),
|
'name' => _x( 'my-account', 'page_slug', 'woocommerce' ),
|
||||||
'title' => __( 'My Account', 'woocommerce' ),
|
'title' => __( 'My Account', 'woocommerce' ),
|
||||||
'content' => '[woocommerce_my_account]'
|
'content' => '[' . apply_filters( 'woocommerce_my_account_shortcode_tag', 'woocommerce_my_account' ) . ']'
|
||||||
)
|
)
|
||||||
) );
|
) );
|
||||||
|
|
||||||
|
|
|
@ -3,36 +3,45 @@
|
||||||
* WC_Shortcodes class.
|
* WC_Shortcodes class.
|
||||||
*
|
*
|
||||||
* @class WC_Shortcodes
|
* @class WC_Shortcodes
|
||||||
* @version 2.0.0
|
* @version 2.1.0
|
||||||
* @package WooCommerce/Classes
|
* @package WooCommerce/Classes
|
||||||
* @category Class
|
* @category Class
|
||||||
* @author WooThemes
|
* @author WooThemes
|
||||||
*/
|
*/
|
||||||
class WC_Shortcodes {
|
class WC_Shortcodes {
|
||||||
|
|
||||||
public function __construct() {
|
/**
|
||||||
// Regular shortcodes
|
* Init shortcodes
|
||||||
add_shortcode( 'product', array( $this, 'product' ) );
|
*/
|
||||||
add_shortcode( 'product_page', array( $this, 'product_page_shortcode' ) );
|
public function init() {
|
||||||
add_shortcode( 'product_category', array( $this, 'product_category' ) );
|
// Define shortcodes
|
||||||
add_shortcode( 'product_categories', array( $this, 'product_categories' ) );
|
$shortcodes = array(
|
||||||
add_shortcode( 'add_to_cart', array( $this, 'product_add_to_cart' ) );
|
'product' => __CLASS__ . '::product',
|
||||||
add_shortcode( 'add_to_cart_url', array( $this, 'product_add_to_cart_url' ) );
|
'product_page' => __CLASS__ . '::product_page',
|
||||||
add_shortcode( 'products', array( $this, 'products' ) );
|
'product_category' => __CLASS__ . '::product_category',
|
||||||
add_shortcode( 'recent_products', array( $this, 'recent_products' ) );
|
'product_categories' => __CLASS__ . '::product_categories',
|
||||||
add_shortcode( 'sale_products', array( $this, 'sale_products' ) );
|
'add_to_cart' => __CLASS__ . '::product_add_to_cart',
|
||||||
add_shortcode( 'best_selling_products', array( $this, 'best_selling_products' ) );
|
'add_to_cart_url' => __CLASS__ . '::product_add_to_cart_url',
|
||||||
add_shortcode( 'top_rated_products', array( $this, 'top_rated_products' ) );
|
'products' => __CLASS__ . '::products',
|
||||||
add_shortcode( 'featured_products', array( $this, 'featured_products' ) );
|
'recent_products' => __CLASS__ . '::recent_products',
|
||||||
add_shortcode( 'woocommerce_messages', array( $this, 'messages_shortcode' ) );
|
'sale_products' => __CLASS__ . '::sale_products',
|
||||||
add_shortcode( 'product_attribute', array( $this, 'product_attribute' ) );
|
'best_selling_products' => __CLASS__ . '::best_selling_products',
|
||||||
add_shortcode( 'related_products', array( $this, 'related_products_shortcode' ) );
|
'top_rated_products' => __CLASS__ . '::top_rated_products',
|
||||||
|
'featured_products' => __CLASS__ . '::featured_products',
|
||||||
|
'product_attribute' => __CLASS__ . '::product_attribute',
|
||||||
|
'related_products' => __CLASS__ . '::related_products',
|
||||||
|
'shop_messages' => __CLASS__ . '::shop_messages',
|
||||||
|
'woocommerce_order_tracking' => __CLASS__ . '::order_tracking',
|
||||||
|
'woocommerce_cart' => __CLASS__ . '::cart',
|
||||||
|
'woocommerce_checkout' => __CLASS__ . '::checkout',
|
||||||
|
'woocommerce_my_account' => __CLASS__ . '::my_account',
|
||||||
|
);
|
||||||
|
|
||||||
// Pages
|
foreach ( $shortcodes as $shortcode => $function )
|
||||||
add_shortcode( 'woocommerce_cart', array( $this, 'cart' ) );
|
add_shortcode( apply_filters( "{$shortcode}_shortcode_tag", $shortcode ), $function );
|
||||||
add_shortcode( 'woocommerce_checkout', array( $this, 'checkout' ) );
|
|
||||||
add_shortcode( 'woocommerce_order_tracking', array( $this, 'order_tracking' ) );
|
// Alias for pre 2.1 compatibility
|
||||||
add_shortcode( 'woocommerce_my_account', array( $this, 'my_account' ) );
|
add_shortcode( 'woocommerce_messages', __CLASS__ . '::shop_messages' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -50,7 +59,7 @@ class WC_Shortcodes {
|
||||||
'before' => null,
|
'before' => null,
|
||||||
'after' => null
|
'after' => null
|
||||||
)
|
)
|
||||||
){
|
) {
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
$before = empty( $wrapper['before'] ) ? '<div class="' . $wrapper['class'] . '">' : $wrapper['before'];
|
$before = empty( $wrapper['before'] ) ? '<div class="' . $wrapper['class'] . '">' : $wrapper['before'];
|
||||||
|
@ -70,8 +79,8 @@ class WC_Shortcodes {
|
||||||
* @param mixed $atts
|
* @param mixed $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function cart( $atts ) {
|
public static function cart( $atts ) {
|
||||||
return $this->shortcode_wrapper( array( 'WC_Shortcode_Cart', 'output' ), $atts );
|
return self::shortcode_wrapper( array( 'WC_Shortcode_Cart', 'output' ), $atts );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,8 +90,8 @@ class WC_Shortcodes {
|
||||||
* @param mixed $atts
|
* @param mixed $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function checkout( $atts ) {
|
public static function checkout( $atts ) {
|
||||||
return $this->shortcode_wrapper( array( 'WC_Shortcode_Checkout', 'output' ), $atts );
|
return self::shortcode_wrapper( array( 'WC_Shortcode_Checkout', 'output' ), $atts );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,8 +101,8 @@ class WC_Shortcodes {
|
||||||
* @param mixed $atts
|
* @param mixed $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function order_tracking( $atts ) {
|
public static function order_tracking( $atts ) {
|
||||||
return $this->shortcode_wrapper( array( 'WC_Shortcode_Order_Tracking', 'output' ), $atts );
|
return self::shortcode_wrapper( array( 'WC_Shortcode_Order_Tracking', 'output' ), $atts );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,8 +112,8 @@ class WC_Shortcodes {
|
||||||
* @param mixed $atts
|
* @param mixed $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function my_account( $atts ) {
|
public static function my_account( $atts ) {
|
||||||
return $this->shortcode_wrapper( array( 'WC_Shortcode_My_Account', 'output' ), $atts );
|
return self::shortcode_wrapper( array( 'WC_Shortcode_My_Account', 'output' ), $atts );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,7 +123,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function product_category( $atts ){
|
public static function product_category( $atts ){
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
if ( empty( $atts ) ) return;
|
if ( empty( $atts ) ) return;
|
||||||
|
@ -194,7 +203,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function product_categories( $atts ) {
|
public static function product_categories( $atts ) {
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
extract( shortcode_atts( array (
|
extract( shortcode_atts( array (
|
||||||
|
@ -268,8 +277,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function recent_products( $atts ) {
|
public static function recent_products( $atts ) {
|
||||||
|
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
extract(shortcode_atts(array(
|
extract(shortcode_atts(array(
|
||||||
|
@ -324,7 +332,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function products( $atts ) {
|
public static function products( $atts ) {
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
if (empty($atts)) return;
|
if (empty($atts)) return;
|
||||||
|
@ -400,7 +408,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function product( $atts ) {
|
public static function product( $atts ) {
|
||||||
if (empty($atts)) return;
|
if (empty($atts)) return;
|
||||||
|
|
||||||
$args = array(
|
$args = array(
|
||||||
|
@ -459,7 +467,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function product_add_to_cart( $atts ) {
|
public static function product_add_to_cart( $atts ) {
|
||||||
global $wpdb, $post;
|
global $wpdb, $post;
|
||||||
|
|
||||||
if ( empty( $atts ) )
|
if ( empty( $atts ) )
|
||||||
|
@ -502,7 +510,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function product_add_to_cart_url( $atts ) {
|
public static function product_add_to_cart_url( $atts ) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
if ( empty( $atts ) ) return;
|
if ( empty( $atts ) ) return;
|
||||||
|
@ -531,7 +539,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function sale_products( $atts ){
|
public static function sale_products( $atts ){
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
extract( shortcode_atts( array(
|
extract( shortcode_atts( array(
|
||||||
|
@ -592,7 +600,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function best_selling_products( $atts ){
|
public static function best_selling_products( $atts ){
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
extract( shortcode_atts( array(
|
extract( shortcode_atts( array(
|
||||||
|
@ -648,7 +656,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function top_rated_products( $atts ){
|
public static function top_rated_products( $atts ){
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
extract( shortcode_atts( array(
|
extract( shortcode_atts( array(
|
||||||
|
@ -710,8 +718,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function featured_products( $atts ) {
|
public static function featured_products( $atts ) {
|
||||||
|
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
extract(shortcode_atts(array(
|
extract(shortcode_atts(array(
|
||||||
|
@ -774,7 +781,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function product_page_shortcode( $atts ) {
|
public static function product_page( $atts ) {
|
||||||
if ( empty( $atts ) ) return;
|
if ( empty( $atts ) ) return;
|
||||||
|
|
||||||
if ( ! isset( $atts['id'] ) && ! isset( $atts['sku'] ) ) return;
|
if ( ! isset( $atts['id'] ) && ! isset( $atts['sku'] ) ) return;
|
||||||
|
@ -826,7 +833,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function messages_shortcode() {
|
public static function shop_messages() {
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
wc_print_messages();
|
wc_print_messages();
|
||||||
|
@ -841,8 +848,7 @@ class WC_Shortcodes {
|
||||||
* @param mixed $args
|
* @param mixed $args
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function order_by_rating_post_clauses( $args ) {
|
public static function order_by_rating_post_clauses( $args ) {
|
||||||
|
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
$args['where'] .= " AND $wpdb->commentmeta.meta_key = 'rating' ";
|
$args['where'] .= " AND $wpdb->commentmeta.meta_key = 'rating' ";
|
||||||
|
@ -868,7 +874,7 @@ class WC_Shortcodes {
|
||||||
* @param array $atts
|
* @param array $atts
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function product_attribute( $atts ) {
|
public static function product_attribute( $atts ) {
|
||||||
global $woocommerce_loop;
|
global $woocommerce_loop;
|
||||||
|
|
||||||
extract( shortcode_atts( array(
|
extract( shortcode_atts( array(
|
||||||
|
@ -930,7 +936,7 @@ class WC_Shortcodes {
|
||||||
return '<div class="woocommerce">' . ob_get_clean() . '</div>';
|
return '<div class="woocommerce">' . ob_get_clean() . '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function related_products_shortcode( $atts ) {
|
public static function related_products( $atts ) {
|
||||||
|
|
||||||
$atts = shortcode_atts( array(
|
$atts = shortcode_atts( array(
|
||||||
'posts_per_page' => '2',
|
'posts_per_page' => '2',
|
||||||
|
@ -950,6 +956,4 @@ class WC_Shortcodes {
|
||||||
|
|
||||||
return ob_get_clean();
|
return ob_get_clean();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
new WC_Shortcodes();
|
|
|
@ -139,6 +139,7 @@ final class WooCommerce {
|
||||||
add_action( 'widgets_init', array( $this, 'include_widgets' ) );
|
add_action( 'widgets_init', array( $this, 'include_widgets' ) );
|
||||||
add_action( 'init', array( $this, 'init' ), 0 );
|
add_action( 'init', array( $this, 'init' ), 0 );
|
||||||
add_action( 'init', array( $this, 'include_template_functions' ) );
|
add_action( 'init', array( $this, 'include_template_functions' ) );
|
||||||
|
add_action( 'init', array( 'WC_Shortcodes', 'init' ) );
|
||||||
add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );
|
add_action( 'after_setup_theme', array( $this, 'setup_environment' ) );
|
||||||
|
|
||||||
// Loaded action
|
// Loaded action
|
||||||
|
@ -177,9 +178,9 @@ final class WooCommerce {
|
||||||
*/
|
*/
|
||||||
public function action_links( $links ) {
|
public function action_links( $links ) {
|
||||||
return array_merge( array(
|
return array_merge( array(
|
||||||
'<a href="' . admin_url( 'admin.php?page=woocommerce_settings' ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>',
|
'<a href="' . admin_url( 'admin.php?page=wc-settings' ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>',
|
||||||
'<a href="http://docs.woothemes.com/documentation/plugins/woocommerce/">' . __( 'Docs', 'woocommerce' ) . '</a>',
|
'<a href="' . esc_url( apply_filters( 'woocommerce_docs_url', 'http://docs.woothemes.com/documentation/plugins/woocommerce/', 'woocommerce' ) ) . '">' . __( 'Docs', 'woocommerce' ) . '</a>',
|
||||||
'<a href="http://support.woothemes.com/">' . __( 'Premium Support', 'woocommerce' ) . '</a>',
|
'<a href="' . esc_url( apply_filters( 'woocommerce_support_url', 'http://support.woothemes.com/' ) ) . '">' . __( 'Premium Support', 'woocommerce' ) . '</a>',
|
||||||
), $links );
|
), $links );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue