-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Converting post metadata to a better system #185
Comments
Candidate for 3.1.0. But, I don't want to rush this as it's a vital component and it needs to be done perfectly. |
Maybe later, it's not pressing. |
In TSF 4.0, we revised how post-metadata is handled, with this issue in mind. |
When we move to this method of storing data, plugins like "Better Search and Replace", and possibly "WP-Optimize", will annihilate the metadata as they pass over it. Here's one recent finding, where "Better Search and Replace" replaces Extension Manager's neatly-packed metadata with |
The next major release provides a basis that allows migrating data. Some considerations:
|
When this is resolved, we can implement filter For now, |
When we migrate, note that WPML may have stored translation data, which we should also migrate. Ref: https://wpml.org/documentation/getting-started-guide/translating-custom-fields/. |
To #185 (comment): From WPML's staff:
<wpml-config>
<custom-fields>
<custom-field action="translate">with_attributes</custom-field>
<custom-field action="translate">with_deep_attributes</custom-field>
<custom-field action="translate">no_attributes</custom-field>
</custom-fields>
<custom-fields-texts>
<key name="with_attributes">
<key name="attribute1" />
<key name="attribute2" />
</key>
<key name="with_deep_attributes">
<key name="attribute1" />
<key name="attribute2">
<key name="level1">
<key name="level2">
</key>
</key>
</key>
</key>
</custom-fields-texts>
</wpml-config> |
Currently, post metadata is stored through individual keys.
This means there are a lot of entries stored in the database, and key collision is prominent.
Current issues:
exclude_from_archive
exclude_local_search
redirect
To resolve this, we must upgrade the metadata from single entries to an array with a common (namespaced) key.
References:
How we did the term meta upgrade:
In WordPress 4.4, new term metadata functionality was added. In TSF 2.7, the Term Metadata upgrade was handled and annotated.
This upgrade was done in one single request.
the-seo-framework/inc/functions/upgrade.php
Lines 117 to 131 in 2c24ef6
This can't be done for posts.
Obstacles:
get_custom_field()
.Propositions
Now, all propositions can work alongside. In all cases, new data will be tested for existence, and will then fall back to old.
Footnotes
When done follow-up: #48
Related functionality: #84
The text was updated successfully, but these errors were encountered: