CustomCssScreen::url(), 'label' => __( 'Edit CSS', 'adminkeep' ), ); } /** * The editing screen. * * @return CustomCssScreen */ public function screen() { if ( null === $this->screen ) { $this->screen = new CustomCssScreen(); } return $this->screen; } /** * Register hooks. * * @param array $settings Resolved settings. Unused — this feature has none. * @return void */ public function boot( array $settings ) { add_action( 'wp_head', array( $this, 'print_css' ), self::HEAD_PRIORITY ); if ( is_admin() ) { $this->screen()->boot(); } } /** * The stored CSS. * * @return string */ public static function css() { $css = get_option( self::OPTION, '' ); return is_string( $css ) ? $css : ''; } /** * Check CSS the way core checks its own Additional CSS: no markup. * * @param string $css Raw CSS. * @return true|\WP_Error */ public static function validate( $css ) { if ( preg_match( '#' . "\n" . wp_strip_all_tags( $css ) . "\n" . '' . "\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } }