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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.