fahidjavid
5/15/2017 - 2:48 PM

A custom customizer control that provide a nice separator between the customizer fields.

A custom customizer control that provide a nice separator between the customizer fields.

<?php
if ( ! class_exists( 'Prefix_Separator_Control' ) ) {
	return null;
}

/**
 * Class Prefix_Separator_Control
 *
 * Custom control to display separator
 */
class Prefix_Separator_Control extends WP_Customize_Control {
	public function render_content() {
		?>
		<label> <br>
			<hr>
			<br> </label>
		<?php
	}
}
<?php
// separator
$wp_customize->add_setting( 'prefix_sample_separator', array(
	'sanitize_callback' => 'themename_sanitize',
) );
$wp_customize->add_control(
	new Prefix_Separator_Control(
		$wp_customize,
		'prefix_sample_separator',
		array(
			'section' => 'prefix_sample_section',
		)
	)
);