do_action( ‘plugin_loaded’, string $plugin )

Fires once a single activated plugin has loaded.

Parameters

$pluginstring
Full path to the plugin’s main file.

Source

do_action( 'plugin_loaded', $plugin );

Changelog

VersionDescription
5.1.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    this plugin is loaded .

    add_action( 'plugin_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 wpdocs_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.