Hi, ReHo20. Thanks for those pointers. After posting this question I found that I could pass a
post_id, or more specifically a **user id** to the
acf_add_options_sub_page() function which enabled me to effectively have an options page which works for editing user meta. The steps I used were:
– Sending the user to admin.php?page=crm-client&user=2 via a custom table of users on my plugin landing page in admin
– Creating an options page with
post_id set to
$_GET the user_id from the URL
– I set the
position to 99 and then hid that menu item with CSS so that my client wouldn’t find themselves on the Client Settings page without an id in the URL, i.e.: they can only get to it via the user table
And it works like a charm! This was always a more desirable solution than hacking the default WP user page in admin as it gives me much more control and means that we still have that more detailed user options page at our disposal.
Thanks again for taking the time to share your solution.
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've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.