WordPress at a glance
function is not described

apache_mod_loaded() WP 2.5.0

Does the specified module exist in the Apache config?

  • Global. true/false. $is_apache

No Hooks.

Return

true/false. Whether the specified module is loaded.

Usage

apache_mod_loaded( $mod, $default );
$mod(string) (required)
The module, e.g. mod_rewrite.
$default(true/false)
The default return value if the module is not found.
Default: false

Code of apache mod loaded: wp-includes/functions.php WP 5.2.2

<?php
function apache_mod_loaded( $mod, $default = false ) {
	global $is_apache;

	if ( ! $is_apache ) {
		return false;
	}

	if ( function_exists( 'apache_get_modules' ) ) {
		$mods = apache_get_modules();
		if ( in_array( $mod, $mods ) ) {
			return true;
		}
	} elseif ( function_exists( 'phpinfo' ) && false === strpos( ini_get( 'disable_functions' ), 'phpinfo' ) ) {
			ob_start();
			phpinfo( 8 );
			$phpinfo = ob_get_clean();
		if ( false !== strpos( $phpinfo, $mod ) ) {
			return true;
		}
	}
	return $default;
}