Adding taxonomy to dashboard
Viewing 2 Posts - 1 through 2 (of 2 total)
Author | Posts |
---|---|
October 12, 2014 at 6:09 pm 28225 | |
Sekander Badsha | I used the code on this page to add a function to add a column to the dashboard for a custom taxonomy: http://docs.wedevs.com/adding-columns-to-dashboard-table/ The taxonomy column appears but the taxonomy doesn't display, just "---" How do I change the second part of the code to display the info in the column? The name of the taxonomy is "Platform" [php] /** Add a new column header in dashboard table **/ function wpufe_dashboard_change_head( $args ) { printf( '<th>%s</th>', __( 'Platform', 'wpuf' ) ); } add_action( 'wpuf_dashboard_head_col', 'wpufe_dashboard_change_head' ); /** Add a new table cell to the dashboard table rows. **/ function wpufe_dashboard_row_col( $args, $post ) { ?> <td> <?php if ( $sub = get_post_meta( $post->ID, 'subhead', true ) ) { echo $sub; } else { echo '---'; } ?> </td> <?php } add_action( 'wpuf_dashboard_row_col', 'wpufe_dashboard_row_col', 10, 2 ); [/php] thanks! |
October 12, 2014 at 6:24 pm 28227 | |
Donald | I can get other info to display in the column when replacing “subhead”, for example with the Meta Key of a Dropdown Field. |
October 16, 2014 at 1:15 pm 28519 | |
Sekander Badsha | Hello Donald, |
Viewing 2 Posts - 1 through 2 (of 2 total)