acf_is_plugin_active()ACF 5.4.0

acf_is_plugin_active

This function will return true if the ACF plugin is active

  • May be included within a theme or other plugin

No Hooks.

Returns

$post_id. (int)

Usage

acf_is_plugin_active();

Changelog

Since 5.4.0 Introduced.

acf_is_plugin_active() code ACF 6.8.8

function acf_is_plugin_active() {

	// vars
	$basename = acf_get_setting( 'basename' );

	// ensure is_plugin_active() exists (not on frontend)
	if ( ! function_exists( 'is_plugin_active' ) ) {
		include_once ABSPATH . 'wp-admin/includes/plugin.php';
	}

	// return
	return is_plugin_active( $basename );
}