<?php

namespace Fab\Controller;

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

use Fab\Metabox\FABMetaboxSetting;
use Fab\Interfaces\JIT_Interface;
use Fab\Helper\FABModal;

/**
 * Related Post.
 *
 * @package    Fab
 * @subpackage Fab/Module
 */
class Related_Post_Type extends Modal_Popup_Group implements JIT_Interface {

    /**
     * Post meta.
     *
     * @var array
     */
    public $post_metas = array(
        'display_count' => array(
            'meta_key' => 'fab_setting_related_post_display_count',
            'default'  => 3,
        ),
    );

    /**
     * Constructor.
     */
    public function __construct() {
        parent::__construct();
        $this->type = 'related_post';
    }

    /**
     * Get labels type.
     *
     * @return array
     */
    public function get_labels_type() {
        return array(
            'name' => __( 'Related Post', 'floating-awesome-button' ),
        );
    }

    /*
    |--------------------------------------------------------------------------
    | Fulfill implemented interface contracts
    |--------------------------------------------------------------------------
     */

    /**
     * JIT Method.
     *
     * @return void
     */
    public static function jit() {
        // Add group type.
        add_filter( 'fab_types_group_modal', array( __CLASS__, 'jit_add_fab_types_group' ), 10, 1 );

        // Add fab setting types.
        add_filter( 'fab_setting_types', array( __CLASS__, 'jit_add_fab_setting_types' ), 10, 1 );
    }
}
