<?php
/**
 * Set the content width in pixels, based on the theme's design and stylesheet.
 *
 * Priority 0 to make it available to lower priority callbacks.
 *
 * @global int $content_width
*/
function is_medify_content_width() {
	$GLOBALS['content_width'] = apply_filters( 'is_medify_content_width', 640 );
}
add_action( 'after_setup_theme', 'is_medify_content_width', 0 );

/**
 * Register widget area.
 *
 * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/

/**
 * Class Sidebars 
*/
class IS_Medify_Sidebars {

	/**
	 * Construct method.
	*/
	public function __construct() {
		$this->IS_Medify_Widgets_Setup_Hooks();
	}

	/**
	 * To register action/filter.
	 *
	 * @return void
	 */
	public function IS_Medify_Widgets_Setup_Hooks() {

		/**
		 * Actions
		*/
		add_action( 'widgets_init', [ $this, 'IS_Medify_Register_Widgets_Sidebars' ] );

	}

	/**
	 * Register widgets.
	 *
	 * @action widgets_init
	*/
	public function IS_Medify_Register_Widgets_Sidebars() {

		register_sidebar(
			[
				'name'          => esc_html__( 'Sidebar', 'is-medify' ),
				'id'            => 'sidebar-1',
				'description'   => esc_html__( 'Add widgets here.', 'is-medify' ),
				'before_widget' => '<div class="row sidebar-widget %2$s">',
				'after_widget' => '</div>',
				'before_title'  => '<h2 class="widget-title">',
				'after_title'   => '</h2>',
			]
		);
	}

}
new IS_Medify_Sidebars;