Hey guys n gals,
I have been surfing the web high and low to find a solution that will allow me to load in a Custom field group of options, so that they can appear above the table on my edit.php page.
More specifically on a CPT page edit.php?post_type=mycpt
As you can see in the screengrab, i have managed to add in content via a filter but i want to replace that with my ACF options (only like 3 options in the CF group)
I can create a sub options page within the CPT left hand menu, but ideally i would like to display it at the top of the edit.php page, so that all the users can see it/engage with it as part of their daily flow.
Can anyone shed any light on this, is it even possible?
Thanks for your help/time
There is nothing in ACF that will let you add a field group in that location. All ACF field groups need to be associated with a single WP “Object” (post, term, user, options page).
Also, WP does not offer any hooks to modify this page.
There may be a way to do this using JS https://solarisedesign.com/blog/adding-content-above-and-below-the-wordpress-admin-posts-table
And it might be possible to use acf_form() to add a custom form there, possibly saved as options. But, to be honest, I’m not sure that would work.
Thanks John.
I found and tested this:
if ( current_user_can('manage_options') ) {
add_action( 'load-edit.php', function() {
add_filter( 'views_edit-cptname', 'function_name_to_Call' );
});
}
It loads in content into that header above the table perfectly, i can load in ACF field values but i cannot get the form in.
I haven’t tried acf_form() yet
Maybe i’ll mess about with it first.