<?php
/**
 * Popup Maker integration.
 *
 * @package MenuVerse
 */

namespace WPXero\MenuVerse\Compat;

defined( 'ABSPATH' ) || exit;

/**
 * Unlocks the `popup` link type, so a bar item can open a popup instead of
 * navigating somewhere.
 */
class Popup_Maker implements Integration {

	/**
	 * Returns the integration identifier.
	 *
	 * @return string
	 */
	public static function id() {
		return 'popup_maker';
	}

	/**
	 * Returns the translated plugin name.
	 *
	 * @return string
	 */
	public static function label() {
		return __( 'Popup Maker', 'menuverse' );
	}

	/**
	 * Tells whether Popup Maker is active.
	 *
	 * The post type is the check rather than a class name: Popup Maker has
	 * renamed and removed its main classes across releases, but the `popup`
	 * post type is what this integration actually needs and has been stable
	 * throughout.
	 *
	 * @return bool
	 */
	public static function is_active() {
		return post_type_exists( 'popup' );
	}
}
