class-link-internal-lookup.php 588 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Admin\Links
  6. */
  7. /**
  8. * Represents the internal link lookup. This class tries get the postid for a given internal link.
  9. */
  10. class WPSEO_Link_Internal_Lookup {
  11. /**
  12. * Gets a post id for the given link for the given type. If type is outbound it returns 0 as post id.
  13. *
  14. * @param string $link The link to populate.
  15. *
  16. * @return int The post id belongs to given link if link is internal.
  17. */
  18. public function lookup( $link ) {
  19. // @codingStandardsIgnoreStart
  20. return url_to_postid( $link );
  21. // @codingStandardsIgnoreEnd
  22. }
  23. }