Initial Commit

This commit is contained in:
David Stone
2024-11-30 18:24:12 -07:00
commit e8f7955c1c
5432 changed files with 1397750 additions and 0 deletions

View File

@ -0,0 +1,49 @@
<?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;
} // end switch;
/**
* 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-ultimo'), '2.0.0');
return $value;
} // end __get;
} // end trait WP_Ultimo_Subscription_Deprecated;