Skip to content

Commit

Permalink
Admin Menu / WooCommerce: Fix product redirect (#40840)
Browse files Browse the repository at this point in the history
* Fix the self-hosted product redirect

* Add changelog

* Fix the significance of the work

* Simplify check

* Import the Host class

* Remove the unnecessary self-hosted check

---------

Co-authored-by: Valter Lorran <[email protected]>

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12691452735

Upstream-Ref: Automattic/jetpack@f54f6be
valterlorran authored and matticbot committed Jan 9, 2025
1 parent 09f7960 commit 392de48
Showing 7 changed files with 100 additions and 91 deletions.
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/automattic/jetpack-masterbar/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.10.6-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Fixes the self-hosted link when WooCommerce is installed alongside with the SSO.

## [0.10.5] - 2025-01-06
### Changed
- Updated package dependencies. [#40784] [#40792] [#40831]
@@ -194,6 +201,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Notifications: Change Icon [#37676]
- Updated package dependencies. [#37669] [#37706]

[0.10.6-alpha]: https://github.com/Automattic/jetpack-masterbar/compare/v0.10.5...v0.10.6-alpha
[0.10.5]: https://github.com/Automattic/jetpack-masterbar/compare/v0.10.4...v0.10.5
[0.10.4]: https://github.com/Automattic/jetpack-masterbar/compare/v0.10.3...v0.10.4
[0.10.3]: https://github.com/Automattic/jetpack-masterbar/compare/v0.10.2...v0.10.3
Original file line number Diff line number Diff line change
@@ -70,9 +70,10 @@ public function get_preferred_view( $screen, $fallback_global_preference = true
*/
public function get_cpt_menu_link( $ptype_obj ) {

$post_type = $ptype_obj->name;
$post_type = $ptype_obj->name;
$is_woocommerce_product = $post_type === 'product' && class_exists( 'WooCommerce' );

if ( ( new Modules() )->is_active( 'sso' ) && $ptype_obj->show_in_rest ) {
if ( ! $is_woocommerce_product && ( new Modules() )->is_active( 'sso' ) && $ptype_obj->show_in_rest ) {
return 'https://wordpress.com/types/' . $post_type . '/' . $this->domain;
} else {
return 'edit.php?post_type=' . $post_type;
2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-masterbar/src/class-main.php
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
*/
class Main {

const PACKAGE_VERSION = '0.10.5';
const PACKAGE_VERSION = '0.10.6-alpha';

/**
* Initializer.
2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
"automattic/jetpack-calypsoify": "^0.2.1-alpha",
"automattic/jetpack-classic-theme-helper": "^0.8.3-alpha",
"automattic/jetpack-connection": "^6.2.2",
"automattic/jetpack-masterbar": "^0.10.5",
"automattic/jetpack-masterbar": "^0.10.6-alpha",
"automattic/jetpack-redirect": "^3.0.1",
"automattic/jetpack-stats-admin": "^0.24.0",
"automattic/jetpack-status": "^5.0.1",
Loading

0 comments on commit 392de48

Please sign in to comment.