Created
December 17, 2015 15:51
-
-
Save megmorsie/26146e2fa81ffd56011c to your computer and use it in GitHub Desktop.
WordPress Stack Exchange: Customiser sections not being displayed with `active_callback`
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
<?php | |
/* | |
* Plugin Name: Stack: Customiser sections not being displayed with `active_callback` | |
* Plugin URI: http://wordpress.stackexchange.com/questions/211164/customiser-sections-not-being-displayed-with-active-callback | |
* Description: Stack Exchange - WordPress Development | |
* Version: 1.0 | |
* Author: Megan Morsie | |
* Author URI: http://megabyterose.com/ | |
* License: GPL2 | |
*/ | |
/* START - Original */ | |
$wp_customise->add_section('section_template_single' , array( | |
'title' => __('Single Links', $this->text_domain), | |
'priority' => 10, | |
'panel' => 'panel_templates', | |
// 'active_callback' => 'is_single' | |
'active_callback' => 'callback_single' // * Changed | |
)); | |
/* END - Original */ | |
/* Added this function. */ | |
function callback_single() { return is_single(); } | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
View my posted answer.