get_main_network_id
Filters the main network ID.
Description
Parameters (1)
- 0. $main_network_id (int)
- The ID of the main network.
Usage
- To run the hook, copy the example below.
- $main_network_id = apply_filters( 'get_main_network_id', $main_network_id );
- if ( !empty( $main_network_id ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the get_main_network_id callback
- function filter_get_main_network_id( $main_network_id ) {
- // make filter magic happen here...
- return $main_network_id;
- };
- // add the filter
- add_filter( 'get_main_network_id', 'filter_get_main_network_id', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'get_main_network_id', 'filter_get_main_network_id', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/functions.php
- return (int) apply_filters( 'get_main_network_id', $main_network_id );