@@ 107-116 (lines=10) @@ | ||
104 | * |
|
105 | * @return Jetpack_Memberships |
|
106 | */ |
|
107 | public static function get_instance() { |
|
108 | if ( ! self::$instance ) { |
|
109 | self::$instance = new self(); |
|
110 | self::$instance->register_init_hook(); |
|
111 | // Yes, `personal-bundle` with a dash, `jetpack_personal` with an underscore. Check the v1.5 endpoint to verify. |
|
112 | self::$required_plan = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? 'personal-bundle' : 'jetpack_personal'; |
|
113 | } |
|
114 | ||
115 | return self::$instance; |
|
116 | } |
|
117 | /** |
|
118 | * Get the map that defines the shape of CPT post. keys are names of fields and |
|
119 | * 'meta' is the name of actual WP post meta field that corresponds. |
@@ 30-37 (lines=8) @@ | ||
27 | // Classic singleton pattern: |
|
28 | private static $instance; |
|
29 | private function __construct() {} |
|
30 | static function getInstance() { |
|
31 | if ( ! self::$instance ) { |
|
32 | self::$instance = new self(); |
|
33 | self::$instance->register_init_hooks(); |
|
34 | self::$required_plan = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? 'value_bundle' : 'jetpack_premium'; |
|
35 | } |
|
36 | return self::$instance; |
|
37 | } |
|
38 | ||
39 | private function register_scripts_and_styles() { |
|
40 | /** |