I have added dark mode support for
WP 2021 theme
WP Dark Mode plugin
WP Droit plugin
As your theme is custom, I cannot include support for it in the plugin with 50,000+ installs. Instead, I have added a JS filter, which can be used to follow dark mode settings on your website.
When v3.5.0 is released, you can set Auto for the hCaptcha theme on the General settings page.
After that, you can add the following file to your wp-content/mu-plugins folder. You should see dark hCaptcha in a dark theme, then.
<?php
function my_print_scripts() {
?>
<script>
document.addEventListener( 'DOMContentLoaded', function() {
const callback = ( darkData ) => {
darkData['blog-stream'] = {
// Blogstream theme.
darkStyleId: 'blogstream-style-css',
darkElement: document.body,
darkClass: 'dark',
};
console.log( 'Data added.' );
return darkData;
};
window.hCaptcha.hooks.addFilter( 'hcaptcha.darkData', 'hcaptcha', callback );
} );
</script>
<?php
}
add_action( 'wp_print_scripts', 'my_print_scripts' );
-
This reply was modified 11 months, 3 weeks ago by kaggdesign.
-
This reply was modified 11 months, 3 weeks ago by kaggdesign.