How To Apply Different Styles To All Blocks Based on Post Meta Value?
I was able to solve this problem by using the admin_body_class filter to add a class name to the <body> element of the admin page, and writing selectors for that class in my stylesheet. add_filter( ‘admin_body_class’, ‘add_status_classes’ ); function add_status_classes( $classes ) { $post_meta = get_post_meta( get_the_ID() ); $is_darkmode = $post_meta[‘_is_post_dark_mode’]; if ( $is_darkmode ) … Read more