I want to add meta fields for the sites in my network (such as a thumbnail and a category). I know how to do this using get
/add
/update_site_option
, but I’m wondering where I could put the UI to manage those meta fields.
The best place would be in the Sites > Infos page, just after the site attributes, but I can’t find any hook to hang on. I can add those fields in the “Settings” tab of the same screen, but one has to scroll down a lot to find it, and it gets mixed with advanced settings.
Any suggestion ?
I finally found a way to add more lines to the Sites > Infos table :
The good part is that as soon as the hook will be available, I can use it without big changes in my code.
First off all â I agreed, there is no specific hooks in this part of the core that allows to create custom setting fields there. But anyway it is possible.
WordPress has
network_edit_site_nav_links
filter hook which allows to create your custom tab.But no hooks for the page for the new tab, but it is not a problem anyway because you can achieve the result with simple options page and a little CSS code.
In this tutorial everything is described by steps https://rudrastyh.com/wordpress-multisite/custom-tabs-with-options.html (I think it is no reason to copy all the code from there to this thread).
The Site Info admin page’s code is here: http://core.trac.wordpress.org/browser/trunk/wp-admin/network/site-info.php
Unfortunately, there don’t appear to be any hooks or filters in the
site-info.php
code.It looks like you’ll have to make your own administrative page — perhaps in the
wp-admin
Settings menu — to handle your{$verb}_site_option
code.