<?php
/**
 * Prodigy breadcrumbs shortcode class
 *
 * @version    3.1.2
 * @package    Prodigy
 * @subpackage Prodigy/includes
 */
namespace Prodigy\Includes\Frontend\Shortcodes;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class Prodigy_Short_Code_Breadcrumbs
 */
class Prodigy_Short_Code_Breadcrumbs_List {

	public function __construct() {
		add_shortcode( 'prodigy_breadcrumbs_list', array( $this, 'output' ) );
	}

	/**
	 * @param array $params
	 *
	 * @return void
	 */
	public function render_view( array $params ) {
		do_action( 'prodigy_shortcode_template_breadcrumbs', $params );
	}

	/**
	 * @param array  $atts
	 * @param null   $content
	 * @param string $name
	 *
	 * @return string
	 */
	public function output( $atts, $name, $content = null ): string {
		ob_start();
		$this->render_view( $atts );
		wp_reset_postdata();
		$content = ob_get_clean();

		return $content;
	}
}
