Skip to content

Fixed: Inconsistancy in add/get/update/delete_post_meta() functions#5476

Open
felipeelia wants to merge 7 commits intoWordPress:trunkfrom
felipeelia:ticket/#58763
Open

Fixed: Inconsistancy in add/get/update/delete_post_meta() functions#5476
felipeelia wants to merge 7 commits intoWordPress:trunkfrom
felipeelia:ticket/#58763

Conversation

@felipeelia
Copy link
Copy Markdown
Member

This just adds unit tests on top of #5216

Trac ticket: https://core.trac.wordpress.org/ticket/58763


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

* @ticket 58763
* @covers ::get_post_meta
*/
public function test_get_post_meta() {
Copy link
Copy Markdown
Member

@adamsilverstein adamsilverstein Jun 12, 2025

Choose a reason for hiding this comment

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

I found this test passes before the patch. To test the fix it should fail before the patch is applied.

Also, the test probably belongs in tests/phpunit/tests/post/meta.php or tests/phpunit/tests/post/metaRevisions.php

@adamsilverstein
Copy link
Copy Markdown
Member

We should check for existing uses (existing plugins) that might be expecting to be able to retrieve meta revisions here (in the case of revisioned meta).

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 15, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @monir@coderex.co.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

Core Committers: Use this line as a base for the props when committing in SVN:

Props mhshujon, felipeelia, adamsilverstein, sirlouen.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@SirLouen
Copy link
Copy Markdown
Member

SirLouen commented Jun 16, 2025

We should check for existing uses (existing plugins) that might be expecting to be able to retrieve meta revisions here (in the case of revisioned meta).

I'm not sure which is your concern here. As you can see here, all plugins simply expect meta from the post, none from revision (prob because it has never been reliable)

I should have added another PR because this is now two years old, I'm starting to doubt if the original submitter is still around. I was expecting that the patch is so trivial that it could be shipped fast. There are multiple versions of code like this and this that prove that this has been missing for ages (and pretty much all the other CRUD post_meta functions already had this)

PS: When you comment here, I don't receive a notification to follow up you (because this is not my PR).
Better comment all concerns directly in Trac.

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.

4 participants