<?php

// Add Footer Text Box section to customize
function kindrex_fcontent( $wp_customize ) {
	$wp_customize->add_section(
		'kindrex-fcontent-section',
		array(
			'title'    => esc_html__( 'Footer Text Box', 'kindrex' ),
			'priority' => '86',
		)
	);

	$wp_customize->add_control(
		new WP_Customize_Control(
			$wp_customize,
			'kindrex-fcontent-text-control', 
			array(
				'type'        => 'button',
				'settings'    => array(),
				'label'       => __( 'Get this feature with premium!', 'kindrex' ),
				'priority'    => 10,
				'section'     => 'kindrex-fcontent-section',
				'input_attrs' => array(
					'value'   => __( 'Click Here!', 'kindrex' ),
					'class'   => 'button-secondary',
					'onclick' => "window.open('https://www.designwicked.com/store/premium-kindrex', '_blank')",
				),
			)
		)
	);
}

add_action( 'customize_register', 'kindrex_fcontent' );

function kindrex_search_form( $form ) {
	$form = '<form method="get" id="searchform" action="' . home_url( '/' ) . '" >
	<input type="text" value="' . get_search_query() . '" name="s" placeholder="What can we help you find?">
	<button type="submit">Search</button>
	</form>';

		return $form;
}

add_filter( 'get_search_form', 'kindrex_search_form' );
