Tribe__Image__Plus__Main::plugins_loaded()
Bootstrap this plugin and all of its pieces
Fired during plugins_loaded action
Source
File: src/Tribe/Main.php
public function plugins_loaded() {
$this->maybe_set_common_lib_info();
$this->init_autoloading();
// Tribe common resources
require_once $this->plugin_path . 'vendor/tribe-common-libraries/tribe-common-libraries.class.php';
Tribe__Main::instance();
// if running an old version of TEC (pre PUE 2.0 with embedded licensing), fake the install key
if ( version_compare( Tribe__Main::VERSION, '4.5.1', '<' ) ) {
add_filter( 'pre_option_pue_install_key_image_widget_plus', array( $this, 'filter_install_key' ) );
}
if ( class_exists( 'Tribe__Main' ) && ! is_admin() && ! class_exists( 'Tribe__Image__Plus__Main' ) ) {
tribe_main_pue_helper();
}
// Load language files.
$mopath = $this->plugin_dir . 'lang/';
$domain = 'image-widget-plus';
// If we don't have Common classes load the old fashioned way
if ( ! class_exists( 'Tribe__Main' ) ) {
load_plugin_textdomain( $domain, false, $mopath );
} else {
// This will load `wp-content/languages/plugins` files first
Tribe__Main::instance()->load_text_domain( $domain, $mopath );
}
// Load other files.
require_once $this->plugin_path . 'src/Tribe/Attachment.php';
require_once $this->plugin_path . 'src/Tribe/Image.php';
require_once $this->plugin_path . 'src/Tribe/Widget.php';
require_once $this->plugin_path . 'src/Tribe/PUE/Helper.php';
require_once $this->plugin_path . 'src/Tribe/PUE.php';
// Initialize other classes.
Tribe__Image__Plus__Attachment::instance();
Tribe__Image__Plus__Widget::instance();
// Register the actual Image Widget Plus widget.
add_action( 'widgets_init', array( $this, 'register_widget' ) );
// Misc. hooks.
add_action( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
$this->pue = new Tribe__Image__Plus__PUE( "{$this->plugin_path}/image-widget-plus.php" );
}
Changelog
| Version | Description |
|---|---|
| 1.0 | Introduced. |