Skip to content

Commit

Permalink
Portfolio CPTs: Ensure WPcom sites immediately hook into the function…
Browse files Browse the repository at this point in the history
… register the CPT, preventing display issues (#39431)

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

Upstream-Ref: Automattic/jetpack@15f921f
  • Loading branch information
coder-karen authored and matticbot committed Sep 18, 2024
1 parent d780666 commit 3514373
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 91 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This is an alpha version! The changes listed here are not final.
### Changed
- Updated package dependencies.

### Fixed
- Portfolios: Ensure these are enabled and working properly on themes that support portfolios

## 2.5.11 - 2024-09-02
### Changed
- Internal updates.
Expand Down
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-classic-theme-helper/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.1-alpha] - unreleased

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

### Fixed
- Portfolios: Ensure these are enabled and working properly on themes that support portfolios

## [0.6.0] - 2024-09-16
### Added
- Content Options: Ensuring feature is now required. [#39210]
Expand Down Expand Up @@ -118,6 +125,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Add wordpress folder on gitignore. [#37177]

[0.6.1-alpha]: https://github.com/Automattic/jetpack-classic-theme-helper/compare/v0.6.0...v0.6.1-alpha
[0.6.0]: https://github.com/Automattic/jetpack-classic-theme-helper/compare/v0.5.6...v0.6.0
[0.5.6]: https://github.com/Automattic/jetpack-classic-theme-helper/compare/v0.5.5...v0.5.6
[0.5.5]: https://github.com/Automattic/jetpack-classic-theme-helper/compare/v0.5.4...v0.5.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/
class Main {

const PACKAGE_VERSION = '0.6.0';
const PACKAGE_VERSION = '0.6.1-alpha';

/**
* Modules to include.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Automattic\Jetpack\Classic_Theme_Helper;

use Automattic\Jetpack\Modules;
use Automattic\Jetpack\Status\Host;
use Jetpack_Options;
use WP_Customize_Image_Control;
use WP_Customize_Manager;
Expand Down Expand Up @@ -60,8 +61,8 @@ public function __construct() {
// If called via REST API, we need to register later in lifecycle.
add_action( 'restapi_theme_init', array( $this, 'maybe_register_cpt' ) );

// If portfolio cpt is enabled, hook into init to register the CPT, otherwise run maybe_register_cpt immediately to deregister.
if ( get_option( self::OPTION_NAME, '0' ) ) {
// If portfolio cpt is enabled (on self hosted sites), hook into init to register the CPT, otherwise run maybe_register_cpt immediately to deregister.
if ( get_option( self::OPTION_NAME, '0' ) || ( new Host() )->is_wpcom_platform() ) {
$this->maybe_register_cpt();
} else {
add_action( 'init', array( $this, 'maybe_register_cpt' ) );
Expand Down
2 changes: 1 addition & 1 deletion vendor/automattic/jetpack-mu-wpcom/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"automattic/jetpack-assets": "^2.3.8",
"automattic/jetpack-blocks": "^2.0.6",
"automattic/jetpack-calypsoify": "^0.1.6",
"automattic/jetpack-classic-theme-helper": "^0.6.0",
"automattic/jetpack-classic-theme-helper": "^0.6.1-alpha",
"automattic/jetpack-connection": "^4.0.4",
"automattic/jetpack-masterbar": "^0.9.2",
"automattic/jetpack-redirect": "^2.0.4",
Expand Down
Loading

0 comments on commit 3514373

Please sign in to comment.