Skip to content

Method

Create the extension instance.

__construct( string $file )

public

Parameters

$file string
The path to the extension file.

Source

public function __construct( $file ) {
    $this->file = $file;
    $this->path = plugin_dir_path( $file );
    $this->url  = plugin_dir_url( $file );

    $this->include_files();
    $this->add_actions();
    $this->add_filters();

    register_activation_hook( $file, array( $this, 'activate' ) );
    register_deactivation_hook( $file, array( $this, 'deactivate' ) );

    add_action( 'plugins_loaded', array( $this, 'maybe_update' ) );
}

Uses

Changelog

VersionDescription
7.0 Introduced.