pre_get_main_site_id

FILTER wp-includes\class-wp-network.php (ligne 230) github
Filters the main site ID. Returning a positive integer will effectively short-circuit the function.

Paramètres

Entrée :
null, $this
Sortie :
@param int|null   $main_site_id If a positive integer is returned, it is interpreted as the main site ID.
@param WP_Network $network      The network object for which the main site was detected.

Utilisation

// Modifier la valeur avec le filtre 'pre_get_main_site_id'
add_filter('pre_get_main_site_id', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre(null) {
    // Modifier la valeur
    return null;
}

Actualités

Chargement des actualités...