Support

Account

Home Forums Backend Issues (wp-admin) Having trouble adding ACF field to admin columns Reply To: Having trouble adding ACF field to admin columns

  • The Code from Elliot’s post doesn’t work for me anymore.
    This is what I used in my functions.php file

    add_action("manage_pages_custom_column", "add_columns");
    add_filter("manage_edit-page_columns", "set_column_content");
    
    function add_columns($columns)
    {
    	$columns = array(
    		'cb'	 	=> '<input type="checkbox" />',
    		'title' 	=> 'Title',
    		'test' 	        => 'Test',
    		'author'	=> 'Author',
    		'date'		=> 'Date',
    	);
    	return $columns;
    }
    
    function set_column_content($column)
    {
    	global $post;
    	if($column == 'test')
    	{
    		echo 'test';
    	}
    }

    I get the following error message:

    Warning: Invalid argument supplied for foreach() in path_to_my_wordpress_install/wp-admin/includes/class-wp-list-table.php on line 1074

    Can someone please confirm this? I don’t think this is an error due to my local setup though.