Skip to main content

To show custom field in posts table in Dashboard

/**** function to show custom field in posts table starts here******/   
add_filter('manage_posts_columns', 'bs_event_table_head');
function bs_event_table_head( $defaults ) {
    $defaults['status']  = 'Status';
    return $defaults;
}
add_action( 'manage_posts_custom_column', 'bs_event_table_content', 10, 2 );
function bs_event_table_content( $column_name, $post_id ) {
    if ($column_name == 'status') {
    echo get_post_meta( $post_id, 'status', true );
    }
}
/**** function to show custom field in posts table ends here******/   

if post type - team
replace:  manage_team_posts_columns, manage_team_posts_custom_column

Comments

Popular posts from this blog

add custom post type

/**  *  * add custom post type  *  */ function my_custom_post_product() {   $labels = array(     'name'               => _x( 'Products', 'post type general name' ),     'singular_name'      => _x( 'Product', 'post type singular name' ),     'add_new'            => _x( 'Add New', 'book' ),     'add_new_item'       => __( 'Add New Product' ),     'edit_item'          => __( 'Edit Product' ),     'new_item'           => __( 'New Product' ),     'all_items'          => __( 'All Products' ),     'vi...

Toolset conditional

[wpv- if evaluate= "'[wpv-current-user info='id']' = '[wpv-post-author format='meta' meta='ID']' OR '[wpv-current-user info='role']' = 'administrator'" ]      //the content you want to hide goes here [/wpv- if ]