get_template();
}
/**
* Whether Blocksy's native Colour Mode Switch extension is active.
*
* @return bool
*/
public static function has_blocksy_color_mode() {
$extensions = get_option( 'blocksy_active_extensions', array() );
if ( is_array( $extensions ) && in_array( 'color-mode-switch', $extensions, true ) ) {
return true;
}
if ( function_exists( 'blc_get_extensions_status' ) ) {
$status = blc_get_extensions_status();
if ( is_array( $status ) && ! empty( $status['color-mode-switch'] ) ) {
return true;
}
}
return (bool) apply_filters( 'blc_ldt_has_blocksy_color_mode', false );
}
/**
* Whether the toggle should render on the current request.
*
* @return bool
*/
public static function should_render() {
if ( is_admin() || wp_doing_ajax() || is_customize_preview() ) {
return false;
}
$settings = BLC_LDT_Settings::get();
if ( empty( $settings['show_on_mobile'] ) && empty( $settings['show_on_desktop'] ) ) {
return false;
}
return (bool) apply_filters( 'blc_ldt_should_render', true );
}
/**
* Warn in admin if the theme is not supported.
*/
public static function admin_theme_notice() {
if ( self::is_target_theme() || ! current_user_can( 'switch_themes' ) ) {
return;
}
$screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
if ( $screen && 'plugins' !== $screen->id ) {
return;
}
echo '
';
echo esc_html__(
'Blocksy Light/Dark Toggle is active but Blocksy is not the current theme. The toggle only appears with Blocksy.',
'blocksy-light-dark-toggle'
);
echo '