do_action( ‘plugins_loaded’ )

Fires once activated plugins have loaded.

Description

Pluggable functions are also available at this point in the loading order.

More Information

The hook is generally used for immediate filter setup, or plugin overrides.

The plugins_loaded action hook fires early, and precedes the setup_theme, after_setup_theme, init and wp_loaded action hooks.

Source

do_action( 'plugins_loaded' );

Changelog

VersionDescription
1.5.0Introduced.

User Contributed Notes

  1. Skip to note 4 content

    you can use instance method when load plugin

    add_action( 'plugins_loaded', array( 'wpdocs_class_name', 'instance' ) );
    
    class wpdocs_class_name {
    	
    	private function __construct() {
    	        self::init();
    	}
    	
    	public static function instance() {
    		static $instance = null;
    
    		if ( is_null( $instance ) ) {
    			$instance = new class_name;
    		}
    		
    		return $instance;
    	}
    	
    	public function init() {
    		wp_die( __( 'Hello World!', 'text-domain' ) );
    	}
    	
    }

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