-
Notifications
You must be signed in to change notification settings - Fork 10
Release 2.7.4 #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 2.7.4 #127
Changes from all commits
05270e6
409fd26
89bb5a7
231758c
48f6214
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -266,21 +266,7 @@ function setup_post_globals( $post_id = null ) { | |
| * @since 2.4.0 - Added support for `terms` context. | ||
| */ | ||
| function setup_term_globals( $term_id = null ) { | ||
| /** | ||
| * Legacy term context global retained for backward compatibility. | ||
| * | ||
| * `$cc_term` predates the managed term-context service. It remains | ||
| * synchronized so existing integrations do not break, but Content Control | ||
| * itself reads the managed `term` value and new integrations should do the | ||
| * same. | ||
| * | ||
| * @deprecated 2.7.1 Use get_global( 'term' ) instead. | ||
| * @var \WP_Term|\WP_Error|false|null $cc_term | ||
| */ | ||
| // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Deprecated compatibility global. | ||
| global $cc_term; | ||
|
|
||
| $current_term = get_global( 'term' ); // Used instead of global $cc_term. | ||
| $current_term = get_global( 'term' ); | ||
|
|
||
| // Return early if we don't have a term ID. | ||
| if ( is_null( $term_id ) ) { | ||
|
|
@@ -302,9 +288,7 @@ function setup_term_globals( $term_id = null ) { | |
| push_to_global( 'overloaded_terms', $current_term_id ); | ||
|
|
||
| // Overload the globals so conditionals work properly. | ||
| $cc_term = get_term( $term_id ); | ||
| // Set the global term object (forward compatibility). | ||
| set_global( 'term', $cc_term ); | ||
| set_global( 'term', get_term( $term_id ) ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When an extension still reads the global Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| return $overload_term; | ||
|
|
@@ -366,24 +350,9 @@ function reset_term_globals() { | |
| return; | ||
| } | ||
|
|
||
| /** | ||
| * Legacy term context global retained for backward compatibility. | ||
| * | ||
| * `$cc_term` predates the managed term-context service. It remains | ||
| * synchronized so existing integrations do not break, but Content Control | ||
| * itself reads the managed `term` value and new integrations should do the | ||
| * same. | ||
| * | ||
| * @deprecated 2.7.1 Use get_global( 'term' ) instead. | ||
| * @var \WP_Term|\WP_Error|false|null $cc_term | ||
| */ | ||
| // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Deprecated compatibility global. | ||
| global $cc_term; | ||
|
|
||
| $stored_term_id = pop_from_global( 'overloaded_terms' ); | ||
| // Reset global post object. | ||
| $cc_term = get_term( $stored_term_id ); | ||
| set_global( 'term', $cc_term ); | ||
| set_global( 'term', get_term( $stored_term_id ) ); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -397,7 +366,7 @@ function get_the_content_id() { | |
| switch ( $context ) { | ||
| case 'terms': | ||
| case 'restapi/terms': | ||
| $term = get_global( 'term' ); // Used instead of global $cc_term. | ||
| $term = get_global( 'term' ); | ||
| return $term->term_id ?? null; | ||
|
|
||
| default: | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the deprecated loader here leaves
bin/stubs/content-control.phpinconsistent with the runtime: it still declaresJP_Content_Control,JP\CC\Is,JP\CC\Site\Restrictions, andjp_content_control()(for example at lines 4256–4323 and 5757–5764). IDEs and static-analysis consumers using this tracked generated stub will therefore accept calls that now fail at runtime, so the stub should be regenerated as part of this API removal.Useful? React with 👍 / 👎.