Last active
April 5, 2017 00:35
-
-
Save jessengatai/90c0ffd458a5da983ba9f2cffd66b668 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add a new section class that allows for adding sectional titles to the customizer | |
* @param class $wp_customize Instance of WP_Customize_Manager created when using the 'customize_register' hook | |
*/ | |
add_action( 'customize_register', 'jn_section_titles_class' ); | |
function jn_section_titles_class($wp_customize) { | |
/** | |
* Extends the WP_Customize_Section for custom output | |
* @return void | |
*/ | |
class JN_Customizer_Section_Title extends WP_Customize_Section { | |
/** | |
* Render the sectional title in the customiser | |
* @access public | |
* @return void | |
*/ | |
public function render() { | |
$id = $this->id; | |
$title = $this->title; | |
$description = $this->description; | |
?> | |
<li id="accordion-section-<?php echo $id; ?>" class="accordion-sectional-title" style=""> | |
<?php if($title) { ?> | |
<h3 class="sectional-title" tabindex="-1"> | |
<?php echo $title; ?> | |
</h3> | |
<?php } ?> | |
<?php if( $description!='' ) { ?> | |
<span class="description sectional-title-description"><?php echo $description; ?></span> | |
<?php } ?> | |
</li> | |
<?php | |
} // end render | |
} // end extend class | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment