Skip to content

Framework: Deprecate gutenberg_get_post_from_context #21662

@aduth

Description

@aduth

Previously: #21467 (#21467 (comment))

Context:

#21467 adds first-class support for block context, which by default includes support for providing the post ID to any block which defines an intent to consume this context value.

This had previously been achieved by the implementation of a gutenberg_get_post_from_context function.

Task:

  1. Replace existing occurrences of gutenberg_get_post_from_context to use block context
    • See Post Title block implementation for prior art
  2. Add _deprecated_function function call in gutenberg_get_post_from_context.
  3. Add entry to deprecations.md for two versions in the future of when the deprecation is added.
  4. (Optional) Move gutenberg_get_post_from_context to a more appropriate file. compat.php is intended to be reserved for functions with a corresponding WordPress proposal ticket proposing the addition of a function.
  5. (Future) Remove the function after the deprecation period has elapsed

Metadata

Metadata

Assignees

Labels

Backwards CompatibilityIssues or PRs that impact backwards compatabilityFrameworkIssues related to broader framework topics, especially as it relates to javascriptGood First IssueAn issue that's suitable for someone looking to contribute for the first time[Status] In ProgressTracking issues with work in progress[Type] Code QualityIssues or PRs that relate to code quality

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions