' . esc_html__( "About", 'amazon-associates-link-builder' ) . '',
'' . esc_html__( "Settings", 'amazon-associates-link-builder' ) . '',
'' . esc_html__( "Templates", 'amazon-associates-link-builder' ) . '',
);
return array_merge( $links, $mylinks );
}
/**
* Autoload the files required for the plugin.
*
* @since 1.0.0
*/
function aalb_autoload() {
//Load the autoloader for mustache.
require_once( MUSTACHE_AUTOLOADER_PHP );
Mustache_Autoloader::register();
require_once( AALB_PLUGIN_DIR . 'vendor/autoload.php' );
//Load the autoloader for plugin files.
require_once( AALB_AUTOLOADER );
Aalb_Autoloader::register();
}
aalb_autoload();
register_activation_hook( __FILE__, array( new Aalb_Activator(), 'activate' ) );
/**
* The code to run on deactivation
*
* CAUTION: Any function present here should contain code that is compatible with at least PHP 5.3(even lower if possible) so
* that anyone not meeting compatibility requirements for min php versions gets deactivated successfully.
*
* @since 1.0.0
*/
function aalb_deactivate() {
$aalb_deactivator = new Aalb_Deactivator();
$aalb_deactivator->remove_cache();
}
register_deactivation_hook( __FILE__, 'aalb_deactivate' );
/**
* The code to run on uninstalltion
*
* @since 1.0.0
*/
function aalb_uninstall() {
$aalb_deactivator = new Aalb_Deactivator();
$aalb_deactivator->remove_settings();
$aalb_deactivator->remove_uploads_dir();
}
register_uninstall_hook( __FILE__, 'aalb_uninstall' );
/**
* Execute the plugin
*
* @since 1.0.0
*/
function aalb_execute() {
$aalb_manager = new Aalb_Manager();
$aalb_manager->execute();
}
add_action( 'plugins_loaded', 'aalb_plugin_load_textdomain' );
/**
* Adds a text-domain to facilitate translation feature
* @since 1.4.8
*/
function aalb_plugin_load_textdomain() {
load_plugin_textdomain( 'amazon-associates-link-builder', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
//To use the function is_plugin_active()
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
/*
* Minimum WP version supported in these activation, deactivation and updates check: 2.8.0
* Minimum PHP version supported in these activation, deactivation and updates check: 5.3
*/
if ( is_plugin_active( plugin_basename( AALB_PLUGIN_DIR . 'amazon-associates-link-builder.php' ) ) ) {
$compatibility_helper = new Aalb_Compatibility_Helper();
if ( $compatibility_helper->is_plugin_compatible() ) {
//All functions to be called from main file should be put inside this check
aalb_execute();
} else {
$compatibility_helper->aalb_deactivate();
}
}
?>