Image_AI_SEO_Settings_Handler::MAIN_KEYWORD_MAX_LENGTH ) { return ''; } return $keyword; } /** * Decodes entities, removes tags and collapses whitespace. * * @param string $text Text as stored by WordPress. * @return string */ public static function to_plain_text( $text ) { $text = wp_strip_all_tags( wp_specialchars_decode( $text, ENT_QUOTES ) ); return trim( (string) preg_replace( '/\s+/u', ' ', $text ) ); } /** * Whether a site option is missing or holds only whitespace. * * @param string $option_name Option name. * @return bool */ private static function is_option_empty( $option_name ) { return '' === trim( (string) get_option( $option_name, '' ) ); } }