Skip to content

Improve Post-Meta handling #1829

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

Merged
merged 5 commits into from
Jun 18, 2025
Merged

Conversation

pfefferle
Copy link
Member

this is a follow up of #1821

Proposed changes:

  • Do not store post-meta if empty or has the default value

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Go to '..'

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Prevent storage of empty or default post meta values.

this is a follow up of #1821
@pfefferle pfefferle self-assigned this Jun 18, 2025
@Copilot Copilot AI review requested due to automatic review settings June 18, 2025 12:05
@pfefferle pfefferle requested a review from obenland June 18, 2025 12:05
Copilot

This comment was marked as outdated.

@pfefferle pfefferle requested review from obenland and Copilot June 18, 2025 14:55
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR prevents storing post-meta values when they are empty or match the default values. The key changes include updating test files to use nowdoc syntax for heredocs, replacing the previous actions with filters to intercept meta additions/updates, and implementing a new function to conditionally delete meta values.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/includes/class-test-mention.php Switched heredoc to nowdoc syntax in test data.
tests/includes/class-test-link.php Updated nowdoc syntax for style and pre blocks in test content.
tests/includes/class-test-hashtag.php Updated nowdoc syntax for style and pre blocks in test content.
includes/class-activitypub.php Replaced actions with filters and refactored meta handling logic.
.github/changelog/1829-from-description Updated changelog entry to document the meta handling change.

@pfefferle
Copy link
Member Author

@obenland all addressed in 034b01b

@pfefferle pfefferle merged commit af20347 into trunk Jun 18, 2025
11 checks passed
@pfefferle pfefferle deleted the update/improve-post-meta-handling branch June 18, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants