class-rest-request-exception.php 689 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * WPSEO plugin file.
  4. *
  5. * @package WPSEO\Internals
  6. */
  7. /**
  8. * Class WPSEO_REST_Request_Exception.
  9. */
  10. class WPSEO_REST_Request_Exception extends Exception {
  11. /**
  12. * Creates a patch failure exception.
  13. *
  14. * @param string $object_type The name of the parameter.
  15. * @param string $object_id The ID of the parameter.
  16. *
  17. * @return WPSEO_REST_Request_Exception The exception.
  18. */
  19. public static function patch( $object_type, $object_id ) {
  20. return new self(
  21. sprintf(
  22. /* translators: %1$s expands to object type. %2$s expands to the object ID. */
  23. __( '%1$s with ID %2$s couldn\'t be patched', 'wordpress-seo' ),
  24. $object_type,
  25. $object_id
  26. )
  27. );
  28. }
  29. }