WordPress.org

Ready to get started?Download WordPress

Forums

How add column in page posts medias (1 post)

  1. wpjudy
    Member
    Posted 9 months ago #

    Hi I want to add a column which displays the users roles in this content

    This is my code:

    add_filter('manage_users_columns', array(&$this,'myusers'));
    		add_action('manage_users_custom_column',  array(&$this,'function_column'), 10, 3);
    		add_filter( 'group_user_sortable_columns', array(&$this,'column_sortable' ));
    		add_filter( 'request', array(&$this,'column_orderby' ));
    
    		//Posts
                    add_filter('manage_posts_columns', array(&$this,'myusers'));
    		add_action('manage_posts_column_column',  'function_column', 10, 3);
    
                    //Pages
                    add_filter('manage_pages_columns', array(&$this,'myusers'));
    		add_action('manage_pages_custom_column',  array(&$this,'function_column'), 10, 3);
    
                    //Media
                    add_filter( 'manage_media_columns',  array(&$this,'myusers'));
                    add_action( 'manage_media_custom_column', array(&$this,'function_column'), 10, 3);   
    
    	function myusers($columns) {
    		$columns['myusers'] = __('Views', 'myusers');
    		return $columns;
    	}
    
    	function function_column( $value, $columnz, $ids ) {
            if ( 'myusers' != $columnze )
               return $value;
            $vars = get_user_meta($ids, 'myusers', TRUE);
            return $this->My_displays[$vars];
    	}

    In users it works fine but in pages and media I have 'Missing argument 3 for aclass::function_column'

    Thank you

Reply

You must log in to post.

About this Topic