| @@ 13-26 (lines=14) @@ | ||
| 10 | * |
|
| 11 | * @return Jetpack_RelatedPosts |
|
| 12 | */ |
|
| 13 | public static function init() { |
|
| 14 | if ( ! self::$instance ) { |
|
| 15 | if ( class_exists('WPCOM_RelatedPosts') && method_exists( 'WPCOM_RelatedPosts', 'init' ) ) { |
|
| 16 | self::$instance = WPCOM_RelatedPosts::init(); |
|
| 17 | } else { |
|
| 18 | self::$instance = new Jetpack_RelatedPosts( |
|
| 19 | get_current_blog_id(), |
|
| 20 | Jetpack_Options::get_option( 'id' ) |
|
| 21 | ); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||
| 25 | return self::$instance; |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|
| 29 | * Creates and returns a static instance of Jetpack_RelatedPosts_Raw. |
|
| @@ 33-46 (lines=14) @@ | ||
| 30 | * |
|
| 31 | * @return Jetpack_RelatedPosts |
|
| 32 | */ |
|
| 33 | public static function init_raw() { |
|
| 34 | if ( ! self::$instance_raw ) { |
|
| 35 | if ( class_exists('WPCOM_RelatedPosts') && method_exists( 'WPCOM_RelatedPosts', 'init_raw' ) ) { |
|
| 36 | self::$instance_raw = WPCOM_RelatedPosts::init_raw(); |
|
| 37 | } else { |
|
| 38 | self::$instance_raw = new Jetpack_RelatedPosts_Raw( |
|
| 39 | get_current_blog_id(), |
|
| 40 | Jetpack_Options::get_option( 'id' ) |
|
| 41 | ); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||
| 45 | return self::$instance_raw; |
|
| 46 | } |
|
| 47 | ||
| 48 | protected $_blog_id_local; |
|
| 49 | protected $_blog_id_wpcom; |
|