Function: get_network

get_network( WP_Network | integer | null $network )

Retrieves network data given a network ID or network object.

Network data will be cached and returned after being passed through a filter. If the provided network is empty, the current network global will be used.


Name Type(s) Default Value Description
$network WP_Network | integer | null null

Optional. Network to retrieve. Default is the current network.


WP_Network | null

The network object or null if not found.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.