| 1 |
<?php |
| 2 |
namespace Elementor\Core\Common\Modules\Connect\Apps; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly |
| 6 |
} |
| 7 |
|
| 8 |
abstract class Common_App extends Base_User_App { |
| 9 |
|
| 10 |
protected static $common_data = null; |
| 11 |
|
| 12 |
/** |
| 13 |
* @since 2.3.0 |
| 14 |
* @access public |
| 15 |
*/ |
| 16 |
public function get_option_name() { |
| 17 |
return static::OPTION_NAME_PREFIX . 'common_data'; |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* @since 2.3.0 |
| 22 |
* @access protected |
| 23 |
*/ |
| 24 |
protected function init_data() { |
| 25 |
if ( is_null( self::$common_data ) ) { |
| 26 |
self::$common_data = get_user_option( static::get_option_name() ); |
| 27 |
|
| 28 |
if ( ! self::$common_data ) { |
| 29 |
self::$common_data = []; |
| 30 |
}; |
| 31 |
} |
| 32 |
|
| 33 |
$this->data = & self::$common_data; |
| 34 |
} |
| 35 |
} |
| 36 |
|