<?php
/**
 * Plugin Name: Blazemedia Offers Black Hole
 * Plugin URI: https://www.blazemedia.it/
 * Description: Removes old affiliation news and put them into the blackhole post-type
 * Version: 1.0.0
 * Author: Blazemedia
 * Author URI: https://blazemedia.it/
 * License: http://www.apache.org/licenses/LICENSE-2.0
 * Text Domain: blz-blackhole
 * Network: false
 *
 * @package blackhole
 *
 * Copyright 2023 Blazemedia (email: techteam@blazemedia.it)
 *
 */
define( 'BLAZE_BLACKHOLE_PATH'   , plugin_dir_path( __FILE__ ) );
define( 'BLAZE_BLACKHOLE_URI'    , plugin_dir_url( __FILE__ ) );
define( 'BLAZE_BLACKHOLE_VERSION', "1.0.0");

if( defined('DOING_CRON') ) return;


require_once BLAZE_BLACKHOLE_PATH . '/vendor/autoload.php';

// use Blazemedia\Blackhole\API;
use Blazemedia\Blackhole\CustomPostTypes;


class Blackhole {

	public function __construct() {

		CustomPostTypes\Blackhole::init();

	}


	function is_wp_rest_api() {

		return str_contains( $_SERVER['REQUEST_URI'], 'wp-json' );
	}
}


new Blackhole;
