PluginProbe
Email Log / 2.1.0
Email Log v2.1.0
2.63 2.4.8 2.4.9 2.6 2.61 2.62 trunk 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.8.1 0.9 0.9.1 0.9.2 1.1 1.5 1.5.1 1.5.2 1.5.3 1.5.4 All 61 releases
email-log / include / Addon / addon-helper.php

addon-helper.php in Email Log 2.1.0, at include/Addon/addon-helper.php

37 lines 860 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Add-on helper functions.
4 * These functions are not using namespace since they may be used from a PHP 5.2 file.
5 *
6 * @since 2.0
7 */
8
9 /**
10 * Load an Email Log add-on.
11 *
12 * @since 2.0.0
13 *
14 * @param string $addon_class Add-on class name.
15 * @param string $addon_file Add-on File.
16 *
17 * @return \EmailLog\Addon\EmailLogAddon Instance of the add-on.
18 */
19 function load_email_log_addon( $addon_class, $addon_file ) {
20 $email_log = email_log();
21
22 $addon_dir = plugin_dir_path( $addon_file );
23 $email_log->loader->add_namespace( 'EmailLog', $addon_dir . 'include' );
24
25 $addon_updater = null;
26
27 if ( ! \EmailLog\Util\is_admin_non_ajax_request() ) {
28 $addon_updater = new \EmailLog\Addon\AddonUpdater( $addon_file );
29 }
30
31 $addon = new $addon_class( $addon_file, $addon_updater );
32
33 add_action( 'el_loaded', array( $addon, 'load' ) );
34
35 return $addon;
36 }
37