Skip to content

Commit 5a721c8

Browse files
authored
Merge pull request #1036 from 10up/feature/deprecate-legacy-settings
Added Admin Notice for Legacy Settings Deprecation
2 parents 5738283 + b6e270c commit 5a721c8

File tree

4 files changed

+58
-4
lines changed

4 files changed

+58
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file, per [the Ke
44

55
## [Unreleased] - TBD
66

7+
### Deprecated
8+
9+
- The legacy settings screen (enabled via the `classifai_use_legacy_settings_panel` filter) is now formally deprecated and scheduled for removal in a future release. An admin notice will be displayed when this filter is active. Please migrate to the new React-based settings experience (props [@zamanq](https://github.com/zamanq), [@jeffpaul](https://github.com/jeffpaul) via [#1036](https://github.com/10up/classifai/pull/1036)).
10+
711
## [3.7.1] - 2026-01-12
812

913
**Note that this release bumps the WordPress minimum from 6.7 to 6.8.**

includes/Classifai/Admin/Notifications.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function maybe_render_notices() {
5050
$this->thresholds_update_notice();
5151
$this->v3_migration_completed_notice();
5252
$this->render_embeddings_notice();
53+
$this->render_legacy_settings_deprecation_notice();
5354
$this->render_notices();
5455
}
5556

@@ -277,6 +278,46 @@ public function render_embeddings_notice() {
277278
<?php
278279
}
279280

281+
/**
282+
* Render a deprecation notice when the legacy settings filter is active.
283+
*
284+
* @since x.x.x
285+
*/
286+
public function render_legacy_settings_deprecation_notice() {
287+
// Only show if the legacy settings filter is active.
288+
if ( ! should_use_legacy_settings_panel() ) {
289+
return;
290+
}
291+
292+
$key = 'legacy_settings_deprecation';
293+
294+
// Don't show the notice if the user has already dismissed it.
295+
if ( get_user_meta( get_current_user_id(), "classifai_dismissed_{$key}", true ) ) {
296+
return;
297+
}
298+
?>
299+
300+
<div class="notice notice-warning is-dismissible classifai-dismissible-notice" data-notice="<?php echo esc_attr( $key ); ?>">
301+
<p>
302+
<strong><?php esc_html_e( 'ClassifAI Legacy Settings Deprecation Notice', 'classifai' ); ?></strong>
303+
</p>
304+
<p>
305+
<?php
306+
echo wp_kses_post(
307+
sprintf(
308+
/* translators: %1$s: filter name, %2$s: documentation URL */
309+
__( 'The legacy settings screen is deprecated and will be removed in a future release. You are currently using the <code>%1$s</code> filter to enable it. Please migrate to the new React-based settings experience and remove this filter from your code. <a href="%2$s" target="_blank" rel="noopener noreferrer">Learn more about the new settings</a>.', 'classifai' ),
310+
'classifai_use_legacy_settings_panel',
311+
'https://10up.github.io/classifai/advanced-docs/useful-snippets#use-legacy-settings'
312+
)
313+
);
314+
?>
315+
</p>
316+
</div>
317+
318+
<?php
319+
}
320+
280321
/**
281322
* Print out a script to dismiss a notice.
282323
*

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ Please report security bugs found in the source code of the undefined plugin thr
6060

6161
== Upgrade Notice ==
6262

63+
= x.x.x =
64+
**Note that the legacy settings screen (enabled via the `classifai_use_legacy_settings_panel` filter) is now formally deprecated and scheduled for removal in a future release. Please migrate to the new React-based settings experience.**
65+
6366
= 3.3.0 =
6467
**Note that this release bumps the WordPress minimum from 6.5 to 6.6.**
6568

wp-hooks-docs/docs/03.advanced-docs/01.useful-snippets.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,19 @@ function my_feature_enqueue_admin_assets( $hook_suffix ) {
536536
add_action( 'admin_enqueue_scripts', 'my_feature_enqueue_admin_assets' );
537537
```
538538

539-
## Use Legacy settings
540-
ClassifAI 3.2.0 introduces React-based settings and deprecates the PHP-based settings pages. If you have customizations in the legacy settings and would like to continue using the legacy settings panel, you can enable this by using the `classifai_use_legacy_settings_panel` filter hook.
539+
## Use Legacy settings (Deprecated)
541540

542-
However, please note that legacy settings will be completely removed in future releases. We recommend updating your customizations to use the React-based settings panel. If you encounter any issues, feel free to report them on our [GitHub repository](https://github.com/10up/classifai/).
541+
:::warning Deprecation Notice
542+
**The legacy settings screen is deprecated and scheduled for removal.** The `classifai_use_legacy_settings_panel` filter will be removed in an upcoming release, followed by the complete removal of all legacy settings code. Please migrate to the new React-based settings experience as soon as possible.
543+
:::
543544

544-
Add the following snippet to your theme's `functions.php` file or a custom plugin.
545+
ClassifAI 3.2.0 introduced React-based settings and deprecated the PHP-based settings pages. If you have customizations in the legacy settings and are still using the legacy settings panel via the `classifai_use_legacy_settings_panel` filter hook, you should plan to migrate immediately.
546+
547+
**Important:** New features and providers added since version 3.2.0 are only available in the new settings experience. The legacy screen is effectively dead code and no longer receives updates.
548+
549+
If you encounter any issues migrating to the new settings, please report them on our [GitHub repository](https://github.com/10up/classifai/).
545550

546551
```php
552+
// DEPRECATED: This filter will be removed in a future release.
547553
add_filter( 'classifai_use_legacy_settings_panel', '__return_true' );
548554
```

0 commit comments

Comments
 (0)