Files
wp-multisite-waas/inc/traits/trait-wp-ultimo-subscription-deprecated.php
David Stone d88e50df38 Prep Plugin for release on WordPress.org (#23)
* Update translation text domain
* Escape everything that should be escaped.
* Add nonce checks where needed.
* Sanitize all inputs.
* Apply Code style changes across the codebase.
* Correct many deprecation notices.
* Optimize load order of many filters.
* Add Proper Build script
* Use emojii flags
* Fix i18n deprecation  notice for translating too early
* Put all scripts in footer and load async
2025-04-14 11:36:46 -06:00

46 lines
935 B
PHP

<?php
/**
* A trait to be included in entities to WU_Subscription Class deprecated methods.
*
* @package WP_Ultimo
* @subpackage Deprecated
* @since 2.0.0
*/
namespace WP_Ultimo\Traits;
/**
* WP_Ultimo_Subscription_Deprecated trait.
*/
trait WP_Ultimo_Subscription_Deprecated {
/**
* Magic getter to provide backwards compatibility for subs.
*
* @since 2.0.0
*
* @throws \Exception Throws an exception when trying to get a key that is not available or back-compat.
* @param string $key Property to get.
* @return mixed
*/
public function __get($key) {
$value = null;
switch ($key) {
case 'plan_id':
$value = $this->get_plan_id();
break;
}
/**
* Let developers know that this is not going to be supported in the future.
*
* @since 2.0.0
*/
_doing_it_wrong($key, __('Membership keys should not be accessed directly', 'wp-multisite-waas'), '2.0.0');
return $value;
}
}