Skip to content

Commit

Permalink
Jetpack Sync: Ensure 'jetpack_sync_callable_whitelist' filter is resp…
Browse files Browse the repository at this point in the history
…ected when added late (#37370)

* Jetpack Sync: Ensure 'jetpack_sync_callable_whitelist' filter is respected when added late

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

Upstream-Ref: Automattic/jetpack@491451f
  • Loading branch information
fgiannar authored and matticbot committed May 14, 2024
1 parent 3e740aa commit 5f50766
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 77 deletions.
52 changes: 26 additions & 26 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-sync/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).

## [2.16.2-alpha] - unreleased

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

### Fixed
- Jetpack Sync: Ensure 'jetpack_sync_callable_whitelist' filter is respected when added late

## [2.16.1] - 2024-05-09
### Changed
- Internal updates.
Expand Down Expand Up @@ -1139,6 +1146,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Packages: Move sync to a classmapped package

[2.16.2-alpha]: https://github.com/Automattic/jetpack-sync/compare/v2.16.1...v2.16.2-alpha
[2.16.1]: https://github.com/Automattic/jetpack-sync/compare/v2.16.0...v2.16.1
[2.16.0]: https://github.com/Automattic/jetpack-sync/compare/v2.15.1...v2.16.0
[2.15.1]: https://github.com/Automattic/jetpack-sync/compare/v2.15.0...v2.15.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class Package_Version {

const PACKAGE_VERSION = '2.16.1';
const PACKAGE_VERSION = '2.16.2-alpha';

const PACKAGE_SLUG = 'sync';

Expand Down
22 changes: 22 additions & 0 deletions vendor/automattic/jetpack-sync/src/modules/class-callables.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,28 @@ public function set_defaults() {
$this->force_send_callables_on_next_tick = false; // Resets here as well mostly for tests.
}

/**
* Set module defaults at a later time.
* Reset the callable whitelist if needed to account for plugins adding the 'jetpack_sync_callable_whitelist'
* and 'jetpack_sync_multisite_callable_whitelist' filters late.
*
* @see Automattic\Jetpack\Sync\Modules::set_module_defaults
* @access public
*/
public function set_late_default() {
if ( is_multisite() ) {
$late_callables = array_merge(
apply_filters( 'jetpack_sync_callable_whitelist', array() ),
apply_filters( 'jetpack_sync_multisite_callable_whitelist', array() )
);
} else {
$late_callables = apply_filters( 'jetpack_sync_callable_whitelist', array() );
}
if ( ! empty( $late_callables ) && is_array( $late_callables ) ) {
$this->callable_whitelist = array_merge( $this->callable_whitelist, $late_callables );
}
}

/**
* Initialize callables action listeners.
*
Expand Down
2 changes: 1 addition & 1 deletion vendor/automattic/scheduled-updates/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"require": {
"php": ">=7.0",
"automattic/jetpack-status": "^3.0.3",
"automattic/jetpack-sync": "^2.16.1",
"automattic/jetpack-sync": "^2.16.2-alpha",
"automattic/jetpack-plans": "^0.4.7",
"automattic/jetpack-constants": "^2.0.2",
"automattic/jetpack-connection": "^2.8.0"
Expand Down
Loading

0 comments on commit 5f50766

Please sign in to comment.