General Network Domain Path Search Pagination Order Count Return Fields Cache Overview Use this tool to create custom code for WordPress Network Query with WP_Network_Query class. Usage Fill in the user-friendly form. Click the “Update Code” button. Copy the code to your project. Or save it as a snippet and share with the community. Examples If you are still learning how to use this tool, check out the following examples: … … … Query Variable Name The variable used in the code. Show The Loop Yes No Show the network loop. Network IDs In Use comma separated list of network IDs to include. Network IDs Not In Use comma separated list of network IDs to exclude. Domain Return networks from a given domain. Domains In Use comma separated list of domains to include. Domains Not In Use comma separated list of domains to exclude. Path Return networks from a given path. Paths In Use comma separated list of paths to include. Paths Not In Use comma separated list of paths to exclude. Search Return networks matching the search criteria. Number Number of networks to return. Offset Number of networks to displace or pass over. Order Choose... ASC - Default DESC Ascending or Descending order. Order by Choose... Network ID (default) Network IDs In Domain Domain Length Path Path Length None Sort retrieved networks by. Counts Choose... True False - Default Whether to return a network count (true) or array of network objects (false). Return Fields Array of Objects (Default) Array of IDs Network fields to return. Networks Cache Choose... True - Default False Whether to prime the cache for found networks. No Found Rows Choose... True - Default False Whether to disable the "SQL_CALC_FOUND_ROWS" query. Update Code Save Snippet
// WP_Network_Query arguments $args = array( ); // The network Query $network_query = new WP_Network_Query( $args );