fix: replace deprecated get_terms() form and tag WP 6.4 conditional - #3199
Closed
faisalahammad wants to merge 2 commits into
Closed
fix: replace deprecated get_terms() form and tag WP 6.4 conditional#3199faisalahammad wants to merge 2 commits into
faisalahammad wants to merge 2 commits into
Conversation
…ional - course.options.php: collapse get_terms( 'tax', 'hide_empty=0' ) to single-argument array form (deprecated since WP 4.5.0). - class-llms-block-templates.php: add phpcs:ignore for the WordPress.WP.RequiresWP sniff on the traverse_and_serialize_blocks() call. Existing function_exists() fallback to _inject_theme_attribute_in_block_template_content() preserved for WP 5.9 -> 6.3. Plugin Check report: lifterlms-lifterlms-php-20260618-170100.md Fixes WordPress.WP.DeprecatedParameters.Get_termsParam2Found (2 sites) and wp_function_not_compatible_with_requires_wp (1 site).
Contributor
|
There's no indication that behaviour will be removed. I'm good to leave as-is for now unless we're forced to change it, and avoid the adding of a phpcs:ignore. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes Plugin Check warnings for deprecated WordPress function signatures in two files. The
get_terms()calls in the course options meta box were using the legacy two-argument string form removed in WP 4.5.0, and thetraverse_and_serialize_blocks()reference in the block templates class needs aphpcs:ignorefor the WP 6.4.0 minimum requirement (plugin minimum is 5.9.0). No behavior change.Changes
includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.phpBefore:
After:
Why:
get_terms()deprecated the second string argument in WP 4.5.0. Modern form takes a single array of args. Same taxonomy, same empty-term inclusion, just the supported signature.includes/class-llms-block-templates.phpBefore:
After:
Why:
traverse_and_serialize_blocks()requires WP 6.4.0 but the plugin supports WP 5.9.0+. The existingfunction_exists()guard plus fallback to_inject_theme_attribute_in_block_template_content()already handles older WP. The annotation tells PHPCS the conditional is intentional.Testing
traverse_and_serialize_blocks().Build
No JS or CSS changes. No build artifact needed.
Validation
All clean. 0 errors on both files. The 3 Plugin Check findings are gone.
Files
includes/admin/post-types/meta-boxes/class.llms.meta.box.course.options.php(2 lines)includes/class-llms-block-templates.php(1 line annotation).changelogs/3199.yml