Enter your keyword

Blog

How to Add/Remove New Columns on wp-admin Products Listing Page

// ADD NEW COLUMN
add_filter( 'manage_edit-product_columns', 'show_product_columns',15 );
function show_product_columns($columns){
//remove column
        unset($columns['sku']);
        unset($columns['product_tag']);
        unset($columns['product_type']);
//add column
        $columns['author'] = __( 'Author');
        return $columns;
}
add_action( 'manage_product_posts_custom_column', 'product_column_author', 10, 2 );
function product_column_author( $column, $postid ) {
    if ( $column == 'author' ) {
    echo $postid;
    }
}

No Comments

Add your review

Your email address will not be published.

* Feilds are Required.