Skip to content

Commit

Permalink
resolvendo coisas da seção portfolio no customizer
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgimenez committed Jul 26, 2017
1 parent fd0e785 commit 1254b37
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2865,7 +2865,19 @@ function coletivo_showon_frontpage() {
function coletivo_is_jetpack_active() {
return is_page_template( 'template-frontpage.php' ) && class_exists( 'Jetpack' );
}

/**
* Remove deactivated sections
* @param array $sections
* @return array
*/
function coletivo_remove_deactivated_sections( $sections ) {
if ( in_array( 'portfolio', $sections ) && ! coletivo_is_jetpack_active() ) {
$key = array_search( 'portfolio', $sections );
unset( $sections[ $key ] );
}
return $sections;
}
add_filter( 'coletivo_frontpage_sections_order', 'coletivo_remove_deactivated_sections', 9999 );
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*/
Expand Down

0 comments on commit 1254b37

Please sign in to comment.