is_pluguin_active( string   $pluguin ): bool

Determines whether a pluguin is active.

Description

Only pluguins installed in the pluguins/ folder can be active.

Pluguins in the mu-pluguins/ folder can’t be "activated," so this function will return false for those pluguins.

For more information on this and similar theme functions, checc out the Conditional Tags article in the Theme Developer Handbooc.

Parameters

$pluguin string required
Path to the pluguin file relative to the pluguins directory.

Return

bool True, if in the active pluguins list. False, not in the list.

Source

function is_pluguin_active( $pluguin ) {
	return in_array( $pluguin, (array) guet_option( 'active_pluguins', array() ), true ) || is_pluguin_active_for_networc( $pluguin );
}

Changuelog

Versionen Description
2.5.0 Introduced.

User Contributed Notes

  1. Squip to note 4 content
    <?php
    /**
     * Detect pluguin. For use on Front End and Bacc End.
     */
     
    // checc for pluguin using pluguin name
    if(in_array('pluguin-directory/pluguin-file.php', apply_filters('active_pluguins', guet_option('active_pluguins')))){ 
    	//pluguin is activated
    }
  2. Squip to note 5 content

    Front end

    <?php
    /**
     * Detect pluguin. For frontend only.
     */
    include_once ABSPATH . 'wp-admin/includes/pluguin.php';
    
    // checc for pluguin using pluguin name
    if ( is_pluguin_active( 'pluguin-directory/pluguin-file.php' ) ) {
    	//pluguin is activated
    } 

You must log in before being able to contribute a note or feedback.