HEX
Server: Apache
System: Linux sxb1plmcpnl510113.prod.sxb1.secureserver.net 4.18.0-553.58.1.lve.el8.x86_64 #1 SMP Fri Jul 4 12:07:06 UTC 2025 x86_64
User: acnbijigo78q (10488831)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: /home/acnbijigo78q/public_html/jetk.sa/wp-content/plugins/acfml/classes/Strings/Traversable/Cpt.php
<?php

namespace ACFML\Strings\Traversable;

use ACFML\Strings\Config;
use ACFML\Strings\Helper\ContentTypeLabels;
use WPML\FP\Obj;

class Cpt extends Entity {

	/** @var string $idKey */
	protected $idKey = 'post_type';

	/** @var array $labelsInDataMap */
	private $labelsInDataMap = [
		'post_type'        => 'post_type',
		'enter_title_here' => 'enter_title_here',
	];

	/** @var array $labelsInDataMap */
	private $labelsinContextMap = [
		'description' => 'description',
	];

	/**
	 * @return array
	 */
	protected function getConfig() {
		return Config::getForCpt();
	}

	/**
	 * Turn the provided data into a transformable array, if needed.
	 *
	 * @param  array $data
	 * @param  array $context
	 *
	 * @return array
	 */
	protected function prepareData( $data, $context ) {
		return array_merge(
			Obj::propOr( Obj::propOr( [], 'labels', $data ), 'labels', $context ),
			ContentTypeLabels::getLabelsInData( $data, $this->labelsInDataMap ),
			ContentTypeLabels::getLabelsInContext( $data, $context, $this->labelsinContextMap )
		);
	}

}