HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/kbdhpghp/vivenciarteatelie.com.br/wp-content/plugins/internal-links/helper/blacklist.php
<?php
namespace ILJ\Helper;

use ILJ\Core\Options;

/**
 * Toolset for Blacklisting
 *
 * Methods for Blacklisting
 *
 * @package ILJ\Helper
 * @since   1.2.15
 */
class Blacklist {

	/**
	 * Get Blacklisted list from option
	 *
	 * @param  string $type Check if Post/Term
	 * @return array    $blacklistedList    List of Blacklisted Post/Terms
	 */
	public static function getBlacklistedList($type) {
		

		if ('post' == $type) {
			$blacklistedList = Options::getOption(\ILJ\Core\Options\Blacklist::getKey());

			

			return $blacklistedList;
		}

	}

	

	/**
	 * Get All Post Types that are Hierarchical , including custom post types
	 *
	 * @return array $post_types List of Hierarchical Post Types
	 */
	protected static function getHierarchicalPostTypes() {
		$args = array(
			'public'       => true,
			'hierarchical' => true,
		);

		$post_types = array_keys(get_post_types($args, 'names'));

		return $post_types;
	}

	/**
	 * Check if ID is Blacklisted
	 *
	 * @param  string $type Checks if Post/Term
	 * @param  int    $id   ID to check
	 * @return bool               Returns True if blacklisted
	 */
	public static function checkIfBlacklisted($type, $id) {
		$list = self::getBlacklistedList($type);
		if ('post' == $type) {
			if (!empty($list)) {
				if (in_array($id, $list)) {
					if (!empty($list)) {
						return true;
					}
				}
			}
		}

		

		return false;
	}
}