<?php
/**
 * Hiring Center integration class
 *
 * @package Teydea_Studio\Careers
 */

namespace Teydea_Studio\Careers\Modules;

use Teydea_Studio\Careers\Dependencies\Utils;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // @codeCoverageIgnore
}

/**
 * The "Module_Hiring_Center_Integration" class
 */
final class Module_Hiring_Center_Integration extends Utils\Module {
	/**
	 * Register hooks
	 *
	 * @return void
	 */
	public function register(): void {
		/**
		 * Disable the default archive template registration by the Hiring Center plugin
		 * - we use custom template for that
		 */
		add_filter( 'hiring_center__can_register_job_archives_template', '__return_false' );

		// Filter the single job post template.
		add_filter( 'hiring_center__job_template', [ $this, 'filter_job_template' ] );
	}

	/**
	 * Filter the single job post template
	 *
	 * @return array<mixed> Post template.
	 */
	public function filter_job_template(): array {
		return [
			[
				'core/heading',
				[ 'placeholder' => __( 'What you will do:', 'careers' ) ],
			],
			[
				'core/paragraph',
				[ 'placeholder' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc quam dolor, posuere et tellus eu, venenatis consequat nisl. Sed vel urna tortor. Pellentesque a consectetur elit. Nam non congue tellus, eget ultricies erat. Morbi sit amet dolor nec odio gravida tempor at et ligula.' ],
			],
		];
	}
}
