Пример #1
0
 /**
  * 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() . '>';
     }
 }
Пример #2
0
 /**
  * Test building a collection URL from a passed screen_name and collection ID
  *
  * @since 1.0.0
  *
  * @covers ::collection
  * @small
  *
  * @dataProvider collectionDataProvider
  *
  * @param string $screen_name screen_name to be used to construct a URL
  * @param string $collection_id collection identifier
  * @param string $url expected result
  * @param string $message error message to display on fail
  *
  * @return void
  */
 public function testCollection($screen_name, $collection_id, $url, $message = '')
 {
     $this->assertEquals($url, \Twitter\Helpers\TwitterURL::collection($screen_name, $collection_id), $message);
 }