# firebox/1.0.13/Inc/Framework/Inc/Helpers/PostsBaseHelper.php

FireBox – WooCommerce Popup Builder, Exit Intent Popup, Email Optin &amp; Cart Abandonment, version 1.0.13. 69 lines.

- Page: https://pluginprobe.com/plugins/firebox/1.0.13/code/Inc/Framework/Inc/Helpers/PostsBaseHelper.php
- Raw: https://pluginprobe.com/plugins/firebox/1.0.13/raw/Inc/Framework/Inc/Helpers/PostsBaseHelper.php
- Modified: 2022-05-16T15:27:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/firebox/1.0.13/code/Inc/Framework/Inc/Helpers/PostsBaseHelper.php#L10-L20`.

```php
<?php
/**
 * @package         FirePlugins Framework
 * @version         1.0.27
 * 
 * @author          FirePlugins <info@fireplugins.com>
 * @link            https://www.fireplugins.com
 * @copyright       Copyright © 2022 FirePlugins All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/

namespace FPFramework\Helpers;

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

class PostsBaseHelper extends SearchDropdownProviderHelper
{
	/**
	 * JOIN clause used by WPML to fetch related items only
	 * 
	 * @var  String
	 */
	const join_clause = " AND (iclt.element_type = 'post_page' || iclt.element_type = 'post_post' || iclt.element_type = 'post_nav_menu_item')";

	public function __construct($provider = null)
	{
		$this->class_name = 'PostsPages';

		parent::__construct($provider);
	}

	/**
	 * Parses given data to a key,value array
	 * 
	 * @param   array  $items
	 * 
	 * @return  array
	 */
	public static function parseData($items)
	{
		$items = (array) $items;

		if (empty($items))
		{
			return [];
		}
		
		$data = [];

		foreach ($items as $key => $item)
		{
			if (!isset($item->id))
			{
				continue;
			}

			$data[] = [
				'id' => $item->id,
				'label' => $item->title,
				'lang' => isset($item->lang) ? $item->lang : ''
			];
		}
		
		return $data;
	}
}
```
