WordPress customizing post lists fields

 

 pluginclass
    {
      ----------------

       #
        add_filter('manage_tickettracker_posts_columns', array( $this, 'tt_table_head' ) ); #'bs_event_table_head');
        add_action( 'manage_tickettracker_posts_custom_column',  array( $this,'tt_table_content'), 10, 2 );
        
    }
    
    
    function tt_table_head( $defaults ) {
        $defaults['priority']  = 'Priority';
        $defaults['status']    = 'Status';
        $defaults['assignee']   = 'Assignee';
        $defaults['author'] = 'Createdby By';
        
        return $defaults;
    }
    
    
    function tt_table_content( $column_name, $post_id ) {
        
        if ($column_name == 'priority') {
            echo $priority = get_post_meta( $post_id, 'tt_fields_priority', true );
            #echo  date( _x( 'F d, Y', 'Event date format', 'textdomain' ), strtotime( $event_date ) );
        }
        if ($column_name == 'status') {
            $status = get_post_meta( $post_id, 'tt_fields_status', true );
            echo $status;
        }
    
        if ($column_name == 'assignee') {
            echo get_post_meta( $post_id, 'tt_fields_assigned', true );
        }
    
    }    
        


// note :- tickettracker :- custome post type name
Author: bm on July 14, 2014
Category: wordpress

Your comment:

Your Name

Comment:




Last articles