Add site options UI in Multisite Sites > Infos page

I finally found a way to add more lines to the Sites > Infos table :
My own option in the Sites > Infos table

It’s a little bit ugly, but it works. I simply use the action admin_footer to add a bunch of HTML code at the end of the page, and then use jQuery to move it to the right place.

add_action('admin_footer', 'user16975_custom_options');
function user16975_custom_options(){
    global $pagenow;
    if( 'site-info.php' == $pagenow ) {
        ?><table><tr id="user16975_custom_options">
            <th scope="row">My own option</th>
            <td><input type="text"/></td>
        </tr></table>
        <script>jQuery(function($){
            $('.form-table tbody').append($('#user16975_custom_options'));
        });</script><?php
    }
}

The good part is that as soon as the hook will be available, I can use it without big changes in my code.

Leave a Comment