blog_id); Age_Gate_Activator::activate(); restore_current_blog(); } } else { require_once plugin_dir_path(__FILE__) . 'includes/class-age-gate-activator.php'; Age_Gate_Activator::activate(); } } /** * The code that runs during plugin deactivation. * This action is documented in includes/class-age-gate-deactivator.php */ function deactivate_age_gate() { require_once plugin_dir_path(__FILE__) . 'includes/class-age-gate-deactivator.php'; Age_Gate_Deactivator::deactivate(); } register_activation_hook(__FILE__, 'activate_age_gate'); register_deactivation_hook(__FILE__, 'deactivate_age_gate'); /** * The core plugin class that is used to define internationalization, * admin-specific hooks, and public-facing site hooks. */ require plugin_dir_path(__FILE__) . 'includes/class-age-gate.php'; /** * Custom function for logging */ if (! function_exists('log_message')) { function log_message($log) { if (!defined('WP_DEBUG') || WP_DEBUG !== true || !defined('WP_DEBUG_LOG') || WP_DEBUG_LOG !== true) { return false; } if (is_array($log) || is_object($log)) { error_log(print_r($log, true)); } else { error_log($log); } } } /** * Begins execution of the plugin. * * Since everything within the plugin is registered via hooks, * then kicking off the plugin from this point in the file does * not affect the page life cycle. * * @since 1.0.0 */ function run_age_gate() { $plugin = new Age_Gate(); $plugin->run(); } run_age_gate();