do_action( 'plugins_loaded' )

Fires once activated plugins have loaded.


Description

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


Top ↑

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.


Top ↑

Source

File: wp-settings.php. View all references

do_action( 'plugins_loaded' );

Top ↑

Changelog

Changelog
Version Description
1.5.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 2 content
    Contributed by Mahdi Ebrahimi

    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.