How to add Custom Blog Options to new blog setup form?

Joining two answers(*), I’ve done a plugin to add a custom meta option when registering a new site (front and back end) and display its value in a column in the Sites screen.

Multisite Categories

enter image description here
enter image description here

(*) code references

1 – WordPress + Multisite: How to add custom blog options to Add New Site form in Network Admin?, by @dennisg

2 – Multisite: How to add Custom Blog Options to new blog setup form?, by @tbuteler

The add_action('wpmu_new_blog', 'add_new_blog_field'); was merged from the two answers.

I was already using the ID column code in my multisite, and also added the Category column in the plugin.

[update]

Tried to make the Category column sortable, but seems almost unsolvable…

See this question/answer: Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php

[update 2]

I’ve reworked the plugin and now the categories are sortable. The first version of the plugin is a Gist now (link updated at the beginning) and the new version stays in GitHub.

Leave a Comment