/** * Link to a site's Twitter profile using rel me * * Adds via attribution to Twitter widgets on the page * * @link http://microformats.org/wiki/rel-me XFN rel me * * @return void */ public static function relMe() { $site_username = \Twitter\WordPress\Site\Username::getViaAttribution(in_the_loop() ? get_the_ID() : null); if ($site_username) { echo '<link rel="me" href="' . esc_url(\Twitter\Helpers\TwitterURL::profile($site_username), array('https', 'http')) . '"' . \Twitter\WordPress\Helpers\HTMLBuilder::closeVoidHTMLElement() . '>'; } }
/** * Test building a profile from a passed screen_name * * @since 1.0.0 * * @covers ::profile * @small * * @dataProvider screenNamesProvider * * @param string $screen_name screen_name to be used to construct a URL * @param string $url expected result * @param string $message error message to display on fail * * @return void */ public function testProfile($screen_name, $url, $message = '') { $this->assertEquals($url, \Twitter\Helpers\TwitterURL::profile($screen_name), $message); }