<?php
/**
 * The sidebar containing the main widget area
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package code4rest
 */

namespace Code4rest;

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

if ( ! code4rest()->has_sidebar() ) {
	return;
}
code4rest()->print_styles( 'code4rest-sidebar' );

?>
<aside id="secondary" role="complementary" class="primary-sidebar widget-area <?php echo esc_attr( code4rest()->sidebar_id_class() ); ?> sidebar-link-style-<?php echo esc_attr( code4rest()->option( 'sidebar_link_style' ) ); ?>">
	<div class="sidebar-inner-wrap">
		<?php
		/**
		 * Hook for before sidebar.
		 */
		do_action( 'code4rest_before_sidebar' );

		code4rest()->display_sidebar();
		/**
		 * Hook for after sidebar.
		 */
		do_action( 'code4rest_after_sidebar' );
		?>
	</div>
</aside><!-- #secondary -->
