Advertisement
fauzanjeg

Change Default State for Dark Mode

Nov 15th, 2021
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  1. /* Change Default State for Dark Mode */
  2. function dark_mode_default_state() {
  3.     if ( ! isset( $_COOKIE['darkmode'] ) ) {
  4.         setcookie( 'darkmode', 'true' );
  5.     }
  6. }
  7. add_action( 'init', 'dark_mode_default_state' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement