| @@ -10,8 +10,12 @@ | ||
| 10 | 10 | */ |
| 11 | 11 | use Automattic\Jetpack\Status\Host; |
| 12 | 12 | use Automattic\Jetpack\Sync\Functions; |
| 13 | 13 | |
| 14 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 15 | + exit( 0 ); | |
| 16 | +} | |
| 17 | + | |
| 14 | 18 | require_once __DIR__ . '/class.json-api-site-jetpack-base.php'; |
| 15 | 19 | require_once __DIR__ . '/class.json-api-post-jetpack.php'; |
| 16 | 20 | |
| 17 | 21 | /** |
| @@ -402,10 +406,8 @@ | ||
| 402 | 406 | |
| 403 | 407 | /** |
| 404 | 408 | * Defaults to false instead of returning the current site plan. |
| 405 | 409 | * |
| 406 | - * @see /modules/masterbar/admin-menu/class-dashboard-switcher-tracking.php. | |
| 407 | - * | |
| 408 | 410 | * @return bool |
| 409 | 411 | */ |
| 410 | 412 | public function get_plan() { |
| 411 | 413 | return false; |
| @@ -424,8 +426,9 @@ | ||
| 424 | 426 | |
| 425 | 427 | /** |
| 426 | 428 | * Defaults to false - this is filled on the WordPress.com side in multiple locations. |
| 427 | 429 | * |
| 430 | + * @see WPCOM_JSON_API_GET_Site_Endpoint::decorate_jetpack_response. | |
| 428 | 431 | * @return bool |
| 429 | 432 | */ |
| 430 | 433 | public function get_capabilities() { |
| 431 | 434 | return false; |
| @@ -564,8 +567,12 @@ | ||
| 564 | 567 | public function is_fse_active() { |
| 565 | 568 | if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) { |
| 566 | 569 | return false; |
| 567 | 570 | } |
| 571 | + if ( function_exists( '\Automattic\Jetpack\Jetpack_Mu_Wpcom\Wpcom_Legacy_FSE\is_full_site_editing_active' ) ) { | |
| 572 | + // @phan-suppress-next-line PhanUndeclaredFunction | |
| 573 | + return \Automattic\Jetpack\Jetpack_Mu_Wpcom\Wpcom_Legacy_FSE\is_full_site_editing_active(); | |
| 574 | + } | |
| 568 | 575 | return function_exists( '\A8C\FSE\is_full_site_editing_active' ) && \A8C\FSE\is_full_site_editing_active(); |
| 569 | 576 | } |
| 570 | 577 | |
| 571 | 578 | /** |
| @@ -581,8 +588,12 @@ | ||
| 581 | 588 | public function is_fse_eligible() { |
| 582 | 589 | if ( ! Jetpack::is_plugin_active( 'full-site-editing/full-site-editing-plugin.php' ) ) { |
| 583 | 590 | return false; |
| 584 | 591 | } |
| 592 | + if ( function_exists( '\Automattic\Jetpack\Jetpack_Mu_Wpcom\Wpcom_Legacy_FSE\is_site_eligible_for_full_site_editing' ) ) { | |
| 593 | + // @phan-suppress-next-line PhanUndeclaredFunction | |
| 594 | + return \Automattic\Jetpack\Jetpack_Mu_Wpcom\Wpcom_Legacy_FSE\is_site_eligible_for_full_site_editing(); | |
| 595 | + } | |
| 585 | 596 | return function_exists( '\A8C\FSE\is_site_eligible_for_full_site_editing' ) && \A8C\FSE\is_site_eligible_for_full_site_editing(); |
| 586 | 597 | } |
| 587 | 598 | |
| 588 | 599 | /** |
| @@ -588,12 +599,13 @@ | ||
| 588 | 599 | /** |
| 589 | 600 | * Check if site should be considered as eligible for use of the core Site Editor. |
| 590 | 601 | * The Site Editor requires a block based theme to be active. |
| 591 | 602 | * |
| 603 | + * @since 12.2 Uses wp_is_block_theme() to determine if site is eligible instead of gutenberg_is_fse_theme(). | |
| 592 | 604 | * @return bool true if site is eligible for the Site Editor |
| 593 | 605 | */ |
| 594 | 606 | public function is_core_site_editor_enabled() { |
| 595 | - return function_exists( 'gutenberg_is_fse_theme' ) && gutenberg_is_fse_theme(); | |
| 607 | + return wp_is_block_theme(); | |
| 596 | 608 | } |
| 597 | 609 | |
| 598 | 610 | /** |
| 599 | 611 | * Return the last engine used for an import on the site. Not used in Jetpack. |
| @@ -639,6 +651,88 @@ | ||
| 639 | 651 | * @return null |
| 640 | 652 | */ |
| 641 | 653 | public function get_user_interactions() { |
| 642 | 654 | return null; |
| 655 | + } | |
| 656 | + | |
| 657 | + /** | |
| 658 | + * Get site deleted status. Not used in Jetpack. | |
| 659 | + * | |
| 660 | + * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php. | |
| 661 | + * | |
| 662 | + * @return bool | |
| 663 | + */ | |
| 664 | + public function is_deleted() { | |
| 665 | + return false; | |
| 666 | + } | |
| 667 | + | |
| 668 | + /** | |
| 669 | + * Indicates that a site is an A4A client. Not used in Jetpack. | |
| 670 | + * | |
| 671 | + * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php. | |
| 672 | + * | |
| 673 | + * @return bool | |
| 674 | + */ | |
| 675 | + public function is_a4a_client() { | |
| 676 | + return false; | |
| 677 | + } | |
| 678 | + | |
| 679 | + /** | |
| 680 | + * Detect whether a site is WordPress.com Staging Site. Not used in Jetpack. | |
| 681 | + * | |
| 682 | + * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php. | |
| 683 | + * | |
| 684 | + * @return false | |
| 685 | + */ | |
| 686 | + public function is_wpcom_staging_site() { | |
| 687 | + return false; | |
| 688 | + } | |
| 689 | + | |
| 690 | + /** | |
| 691 | + * Get site option for the production blog id (if is a WP.com Staging Site). Not used in Jetpack. | |
| 692 | + * | |
| 693 | + * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php. | |
| 694 | + * | |
| 695 | + * @return null | |
| 696 | + */ | |
| 697 | + public function get_wpcom_production_blog_id() { | |
| 698 | + return null; | |
| 699 | + } | |
| 700 | + | |
| 701 | + /** | |
| 702 | + * Get site option for the staging blog ids (if it has them). Not used in Jetpack. | |
| 703 | + * | |
| 704 | + * @see /wpcom/public.api/rest/sal/trait.json-api-site-wpcom.php. | |
| 705 | + * | |
| 706 | + * @return null | |
| 707 | + */ | |
| 708 | + public function get_wpcom_staging_blog_ids() { | |
| 709 | + return null; | |
| 710 | + } | |
| 711 | + | |
| 712 | + /** | |
| 713 | + * Get site option for the admin interface on WordPress.com Atomic sites. Not used in Jetpack. | |
| 714 | + * | |
| 715 | + * @return null | |
| 716 | + */ | |
| 717 | + public function get_wpcom_admin_interface() { | |
| 718 | + return null; | |
| 719 | + } | |
| 720 | + | |
| 721 | + /** | |
| 722 | + * Get Zendesk site meta. Not used in Jetpack. | |
| 723 | + * | |
| 724 | + * @return null | |
| 725 | + */ | |
| 726 | + public function get_zendesk_site_meta() { | |
| 727 | + return null; | |
| 728 | + } | |
| 729 | + | |
| 730 | + /** | |
| 731 | + * Detect whether there's a pending plan for this site. Not used in Jetpack. | |
| 732 | + * | |
| 733 | + * @return false | |
| 734 | + */ | |
| 735 | + public function is_pending_plan() { | |
| 736 | + return false; | |
| 643 | 737 | } |
| 644 | 738 | } |