Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // add a new menu order column to the product list view
- add_filter( 'manage_product_posts_columns', 'custom_product_posts_columns', 99 );
- function custom_product_posts_columns( $columns ) {
- $columns['menu_order'] = 'Menu order';
- return $columns;
- }
- // show the value
- add_action( 'manage_product_posts_custom_column' , 'custom_columns', 10, 2 );
- function custom_columns( $column_name, $post_id ) {
- switch ( $column_name ) {
- case 'menu_order':
- $product = wc_get_product( $post_id);
- print $product->get_menu_order();
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement