pre_get_main_site_id хук-фильтр . WP 4.9.0
Filters the main site ID.
Returning a positive integer will effectively short-circuit the function.
Использование
add_filter( 'pre_get_main_site_id', 'filter_function_name_7162', 10, 2 ); function filter_function_name_7162( $main_site_id, $network ){ // filter... return $main_site_id; }
- $main_site_id(число/null)
- If a positive integer is returned, it is interpreted as the main site ID.
- $network(WP_Network)
- The network object for which the main site was detected.
Список изменений
С версии 4.9.0 | Введена. |
Где вызывается хук
pre_get_main_site_id
wp-includes/class-wp-network.php 229
$main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this );