Home › Forums › ACF PRO › Show acf-field values and quicksettings in admin panel columns › Reply To: Show acf-field values and quicksettings in admin panel columns
// ADD NEW COLUMN
function v2008_c_head($defaults) {
$column_name = 'solution';//column slug
$column_heading = 'Solution';//column heading
$defaults[$column_name] = $column_heading;
return $defaults;
}
// SHOW THE COLUMN CONTENT
function v2008_c_content($name, $post_ID) {
$column_name = 'solution';//column slug
$column_field = 'solution_type';//field slug
if ($name == $column_name) {
$post_meta = get_post_meta($post_ID,$column_field,true);
if ($post_meta) {
echo $post_meta;
}
}
}
// ADD STYLING FOR COLUMN
function v2008_c_style(){
$column_name = 'solution';//column slug
echo "<style>.column-$column_name{width:10%;}</style>";
}
add_filter('manage_solutions_posts_columns', 'v2008_c_head');
add_action('manage_solutions_posts_custom_column', 'v2008_c_content', 10, 2);
add_filter('admin_head', 'v2008_c_style');
yet without filtering
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.