<?php

namespace Blazemedia\Affiliation\Rendering;

class Zone extends RenderingTemplate {

    public function __construct() {

        //parent::__construct( 'affiliate_link', 'link' );

        add_shortcode( 'affiliate_zone',  [ $this, 'manageLink'] );
    }

    
    public function manageLink( $atts, $content, $tag ) {

        if( !isset( $atts['zone_id']) ) return '';
        
        $zone = get_post( $atts['zone_id'] );

        return do_shortcode( $zone->post_content );
    }

}


