Add custom column to dashboard

By

// Add to a column in WP-Admin
add_filter('manage_posts_columns', 'posts_custom_columnb');
add_action('manage_posts_custom_column', 'posts_custom_column_content',5,2);
function posts_custom_columnb($defaults){
    $defaults['custom_column_slug'] = __('Custom Column');
    return $defaults;  
}
function posts_custom_column_content($column_name, $id){
    if($column_name === 'custom_column_slug'){
        echo 'any content you want';
    }
}

Leave a Comment