Made attributes handle less generic

This commit is contained in:
Mike Jolley 2011-09-22 13:41:16 +01:00
parent ca5b2e5f63
commit 0b1b8836cc
3 changed files with 9 additions and 9 deletions

View File

@ -29,7 +29,7 @@ function woocommerce_attributes() {
$wpdb->insert( $wpdb->prefix . "woocommerce_attribute_taxonomies", array( 'attribute_name' => $attribute_name, 'attribute_label' => $attribute_label, 'attribute_type' => $attribute_type ), array( '%s', '%s' ) );
wp_safe_redirect( get_admin_url() . 'admin.php?page=attributes' );
wp_safe_redirect( get_admin_url() . 'admin.php?page=woocommerce_attributes' );
exit;
endif;
@ -47,7 +47,7 @@ function woocommerce_attributes() {
endif;
wp_safe_redirect( get_admin_url() . 'admin.php?page=attributes' );
wp_safe_redirect( get_admin_url() . 'admin.php?page=woocommerce_attributes' );
exit;
elseif (isset($_GET['delete'])) :
@ -71,7 +71,7 @@ function woocommerce_attributes() {
endif;
wp_safe_redirect( get_admin_url() . 'admin.php?page=attributes' );
wp_safe_redirect( get_admin_url() . 'admin.php?page=woocommerce_attributes' );
exit;
endif;
@ -112,7 +112,7 @@ function woocommerce_edit_attribute() {
<div class="form-wrap">
<h3><?php _e('Edit Attribute', 'woothemes') ?></h3>
<p><?php _e('Attribute taxonomy names cannot be changed; you may only change an attributes type.', 'woothemes') ?></p>
<form action="admin.php?page=attributes&amp;edit=<?php echo $edit; ?>" method="post">
<form action="admin.php?page=woocommerce_attributes&amp;edit=<?php echo $edit; ?>" method="post">
<div class="form-field">
<label for="attribute_label"><?php _e('Attribute Label', 'woothemes'); ?></label>
@ -172,7 +172,7 @@ function woocommerce_add_attribute() {
<td><a href="edit-tags.php?taxonomy=<?php echo $woocommerce->attribute_taxonomy_name($tax->attribute_name); ?>&amp;post_type=product"><?php echo $tax->attribute_name; ?></a>
<div class="row-actions"><span class="edit"><a href="<?php echo esc_url( add_query_arg('edit', $tax->attribute_id, 'admin.php?page=attributes') ); ?>"><?php _e('Edit', 'woothemes'); ?></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=attributes'), 'woocommerce-delete-attribute_' . $tax->attribute_id ) ); ?>"><?php _e('Delete', 'woothemes'); ?></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=woocommerce_attributes') ); ?>"><?php _e('Edit', 'woothemes'); ?></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', 'woothemes'); ?></a></span></div>
</td>
<td><?php echo ucwords($tax->attribute_label); ?></td>
<td><?php echo ucwords($tax->attribute_type); ?></td>
@ -207,7 +207,7 @@ function woocommerce_add_attribute() {
<div class="form-wrap">
<h3><?php _e('Add New Attribute', 'woothemes') ?></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.', 'woothemes') ?></p>
<form action="admin.php?page=attributes" method="post">
<form action="admin.php?page=woocommerce_attributes" method="post">
<div class="form-field">
<label for="attribute_name"><?php _e('Attribute Name', 'woothemes'); ?></label>
<input name="attribute_name" id="attribute_name" type="text" value="" maxlength="29" />

View File

@ -41,10 +41,10 @@ function woocommerce_content_right_now() {
<td class="t"><a href="edit-tags.php?taxonomy=product_tag&post_type=product"><?php _e('Product Tags', 'woothemes'); ?></a></td>
</tr>
<tr>
<td class="first b"><a href="admin.php?page=attributes"><?php
<td class="first b"><a href="admin.php?page=woocommerce_attributes"><?php
echo sizeof($woocommerce->get_attribute_taxonomies());
?></a></td>
<td class="t"><a href="admin.php?page=attributes"><?php _e('Attribute taxonomies', 'woothemes'); ?></a></td>
<td class="t"><a href="admin.php?page=woocommerce_attributes"><?php _e('Attribute taxonomies', 'woothemes'); ?></a></td>
</tr>
<?php
}

View File

@ -63,7 +63,7 @@ function woocommerce_admin_menu() {
add_menu_page(__('WooCommerce'), __('WooCommerce'), 'manage_woocommerce', 'woocommerce' , 'woocommerce_settings', $woocommerce->plugin_url() . '/assets/images/icons/menu_icons.png', 55);
add_submenu_page('woocommerce', __('General Settings', 'woothemes'), __('Settings', 'woothemes') , 'manage_woocommerce', 'woocommerce', 'woocommerce_settings');
add_submenu_page('woocommerce', __('Reports', 'woothemes'), __('Reports', 'woothemes') , 'manage_woocommerce', 'woocommerce_reports', 'woocommerce_reports');
add_submenu_page('edit.php?post_type=product', __('Attributes', 'woothemes'), __('Attributes', 'woothemes'), 'manage_woocommerce', 'attributes', 'woocommerce_attributes');
add_submenu_page('edit.php?post_type=product', __('Attributes', 'woothemes'), __('Attributes', 'woothemes'), 'manage_woocommerce', 'woocommerce_attributes', 'woocommerce_attributes');
}
function woocommerce_admin_menu_order( $menu_order ) {