Skip to content

Commit

Permalink
WordPress 6.7 compat: Removes early i18n calls to fix notices. (#40474)
Browse files Browse the repository at this point in the history
* Move admin menu initialization to the init hook.

* Changelogs.

* Added Config callbacks for package options.

* Removed the i18n call from deprecation notices for early calls.

* Changelog.

* Update projects/plugins/jetpack/functions.global.php

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

---------

Co-authored-by: Brad Jorsch <anomiex@users.noreply.github.com>

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

Upstream-Ref: Automattic/jetpack@c2f3354
  • Loading branch information
zinigor authored and matticbot committed Dec 9, 2024
1 parent c649813 commit df35562
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 147 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This is an alpha version! The changes listed here are not final.
### Improved compatibility
- External media: Google Photos Picker: Update UX opening picker right after pressing "change selection" CTA
- Jetpack SEO: Ensures we now support adding an SEO title and description for custom post types.
- WordPress 6.7 Compatibility: Fixed notices caused by translation calls happening too early in the load order.

### Bug fixes
- Google Fonts: Clean up the google fonts data if either google fonts module is disabled or Jetpack is disabled
Expand Down
6 changes: 4 additions & 2 deletions functions.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ function jetpack_deprecated_function( $function, $replacement, $version ) { // p
) {
error_log( // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
sprintf(
/* Translators: 1. Function name. 2. Jetpack version number. */
__( 'The %1$s function will be removed from the Jetpack plugin in version %2$s.', 'jetpack' ),
doing_action( 'after_setup_theme' ) || did_action( 'after_setup_theme' ) ?
/* Translators: 1. Function name. 2. Jetpack version number. */
__( 'The %1$s function will be removed from the Jetpack plugin in version %2$s.', 'jetpack' )
: 'The %1$s function will be removed from the Jetpack plugin in version %2$s.',
$function,
$removed_version
)
Expand Down
1 change: 1 addition & 0 deletions jetpack_vendor/automattic/jetpack-connection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
This is an alpha version! The changes listed here are not final.

### Added
- Added a mechanism to use callbacks for package options.
- REST user provisioning with an app password.

## [6.1.1] - 2024-12-04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ function ( $c1, $c2 ) {
continue;
}

if ( isset( $consumer['customContent'] ) && is_callable( $consumer['customContent'] ) ) {
$consumer['customContent'] = call_user_func( $consumer['customContent'] );
}

if ( isset( $_SERVER['REQUEST_URI'] ) && str_starts_with( filter_var( wp_unslash( $_SERVER['REQUEST_URI'] ) ), $consumer['admin_page'] ) && strlen( $consumer['admin_page'] ) > $consumer_url_length ) {
$consumer_chosen = $consumer;
$consumer_url_length = strlen( $consumer['admin_page'] );
Expand Down
2 changes: 1 addition & 1 deletion jetpack_vendor/i18n-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
),
'jetpack-connection' => array(
'path' => 'jetpack_vendor/automattic/jetpack-connection',
'ver' => '6.2.0-alpha1733428152',
'ver' => '6.2.0-alpha1733749108',
),
'jetpack-explat' => array(
'path' => 'jetpack_vendor/automattic/jetpack-explat',
Expand Down
Loading

0 comments on commit df35562

Please sign in to comment.