Hello, I’m looking to find out the best way to save an array of ids per user that’s editable from admin panel.
Example use case:
– Create an admin page with a dropdown list of all users (or searchable text box, etc). And select a user.
– Once a user has been selected, a list of pages will be loaded accompanied by a checkbox.
– There can be none, some, or all of the checkboxes checked per page.
– This will need save an array of the page ids of the pages that are checked and be connected to the user.
– On the plugin side you could do (pseudo here) myarray = get_my_array(current_user_id) which would return an array of those ids saved.
– This could then be used for example in WP_Query post__in to get those pages.
My guess would be to use to simply store it in user_meta. Is this best practice? Thank you.
[ad_2]