Beispiel #1
0
        //trigger any uninstall hook that is registered by any extension
        do_action('aam-uninstall-action');
        //remove aam directory if exists
        $dirname = WP_CONTENT_DIR . '/aam';
        if (file_exists($dirname)) {
            AAM_Core_API::removeDirectory($dirname);
        }
        //clear schedules
        wp_clear_scheduled_hook('aam-cron');
    }
}
if (defined('ABSPATH')) {
    //define few common constants
    define('AAM_MEDIA', plugins_url('/media', __FILE__));
    define('AAM_KEY', 'advanced-access-manager');
    define('AAM_BASE', dirname(__FILE__));
    //register autoloader
    require dirname(__FILE__) . '/autoloader.php';
    AAM_Autoloader::register();
    //the highest priority (higher the core)
    //this is important to have to catch events like register core post types
    add_action('init', 'AAM::getInstance', -1);
    //schedule cron
    if (!wp_next_scheduled('aam-cron')) {
        wp_schedule_event(time(), 'daily', 'aam-cron');
    }
    add_action('aam-cron', 'AAM::cron');
    //activation & deactivation hooks
    register_activation_hook(__FILE__, array('AAM', 'activate'));
    register_uninstall_hook(__FILE__, array('AAM', 'uninstall'));
}
Beispiel #2
0
<?php

/**
 * ======================================================================
 * LICENSE: This file is subject to the terms and conditions defined in *
 * file 'license.txt', which is part of this source code package.       *
 * ======================================================================
 */
if (defined('AAM_KEY') && !defined('AAM_UTILITIES')) {
    //define extension constant as it's version #
    define('AAM_UTILITIES', '1.3.2');
    //register activate and extension classes
    $basedir = dirname(__FILE__);
    AAM_Autoloader::add('AAM_Utilities', $basedir . '/Utilities.php');
    AAM_Utilities::bootstrap();
}