Nessuna descrizione

Package.php 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Deprecated notice: This class is deprecated as of version 4.5.0. WooCommerce API is now part of core and not packaged seperately.
  4. *
  5. * Returns information about the package and handles init.
  6. *
  7. * @package WooCommerce\RestApi
  8. */
  9. namespace Automattic\WooCommerce\RestApi;
  10. defined( 'ABSPATH' ) || exit;
  11. /**
  12. * Main package class.
  13. *
  14. * @deprecated Use \Automattic\WooCommerce\RestApi\Server directly.
  15. */
  16. class Package {
  17. /**
  18. * Version.
  19. *
  20. * @deprecated since 4.5.0. This tracks WooCommerce version now.
  21. * @var string
  22. */
  23. const VERSION = WC_VERSION;
  24. /**
  25. * Init the package - load the REST API Server class.
  26. *
  27. * @deprecated since 4.5.0. Directly call Automattic\WooCommerce\RestApi\Server::instance()->init()
  28. */
  29. public static function init() {
  30. wc_deprecated_function( 'Automattic\WooCommerce\RestApi\Server::instance()->init()', '4.5.0' );
  31. \Automattic\WooCommerce\RestApi\Server::instance()->init();
  32. }
  33. /**
  34. * Return the version of the package.
  35. *
  36. * @deprecated since 4.5.0. This tracks WooCommerce version now.
  37. * @return string
  38. */
  39. public static function get_version() {
  40. wc_deprecated_function( 'WC()->version', '4.5.0' );
  41. return WC()->version;
  42. }
  43. /**
  44. * Return the path to the package.
  45. *
  46. * @deprecated since 4.5.0. Directly call Automattic\WooCommerce\RestApi\Server::get_path()
  47. * @return string
  48. */
  49. public static function get_path() {
  50. wc_deprecated_function( 'Automattic\WooCommerce\RestApi\Server::get_path()', '4.5.0' );
  51. return \Automattic\WooCommerce\RestApi\Server::get_path();
  52. }
  53. }