Created
February 15, 2018 13:00
-
-
Save albionselimaj/7fb2a94e4eec36ce5a7f283477f50ce4 to your computer and use it in GitHub Desktop.
Add 'Product Type' column in User Dashboard > My Listings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'job_manager_job_dashboard_columns', function( $columns ) { | |
$columns['product_type'] = 'Product Type'; | |
return $columns; | |
} ); | |
add_action( 'job_manager_job_dashboard_column_product_type', function( $listing ) { | |
if ( ! $listing->_package_id || ! ( $product = wc_get_product( $listing->_package_id ) ) ) { | |
return false; | |
} | |
echo $product->get_name(); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment