static function clean_text($text) { return trim(preg_replace('/[\\s]+/', ' ', preg_replace('@https?://[\\S]+@', '', strip_shortcodes(strip_tags($text))))); }
/** * @author scotchfield * @covers Jetpack_Media_Summary::clean_text * @since 3.2 */ public function test_mediasummary_clean_text_simple() { $shortcode = 'test_mediasummary_shortcode'; add_shortcode($shortcode, array($this, 'shortcode_nop')); $content = '[' . $shortcode . '] <a href="' . WP_TESTS_DOMAIN . '">test</a>'; $this->assertEquals(Jetpack_Media_Summary::clean_text($content), 'test'); }