/wp-content/plugins/wordpress-seo/admin/links/class-link-internal-lookup.php

https://bitbucket.org/carloskikea/helpet · PHP · 25 lines · 6 code · 2 blank · 17 comment · 0 complexity · f5976f31e81513ec6a52c1a7d0cf4e29 MD5 · raw file

  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. }