WordPress.org

Ready to get started?Download WordPress

Forums

Verve Meta Boxes
[resolved] Cant add Custom Column Info in write post page (4 posts)

  1. DGWordPressUser
    Member
    Posted 4 years ago #

    I am trying to add my meta box 'project_type' from custom post type 'project' as a new custom column:

    add_filter('manage_edit-project_columns', 'project_columns');
    add_action('manage_project_custom_column', 'project_custom_column', 10, 2);

    function project_columns($defaults) {
    $defaults['project_type'] = 'Project Type';
    return $defaults;
    }

    function project_custom_column($column_name, $post_id) {
    global $wpdb;
    if( $column_name == 'project_type' ) {
    echo get_post_meta($post_id, 'project', true);
    }
    }
    The column shows, but the value never does. I am wondering if this has anything to do with the plugin?

    http://wordpress.org/extend/plugins/verve-meta-boxes/

  2. DGWordPressUser
    Member
    Posted 4 years ago #

    Anyone?

  3. DGWordPressUser
    Member
    Posted 4 years ago #

    OK Just figured out. Man was struggling with this for ages, what a relief.

    changed: add_action("manage_posts_custom_column", "project_custom_columns");

    to:
    add_action("manage_pages_custom_column", "project_custom_columns");

    Hope it helps someone.

  4. marky_uk
    Member
    Posted 3 years ago #

    Thank you, thank you, thank you :-)

    Ditto - struggling for ages! :-)

    Marky_UK

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic