Skip to content
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

Add introduced, modified and deprecated version post meta to imported posts #209

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

keesiemeijer
Copy link
Contributor

@keesiemeijer keesiemeijer commented Jan 29, 2019

As disscussed in ticked #2847 there is no easy way to query for posts with these type of change versions. This pull request imports the different change versions as post meta.

For example, with this pull request you can now query for deprecated functions in WordPress 4.9 like this.

$args = array(
	'post_type'  => 'wp-parser-function',
	'meta_key'   => '_wp-parser_deprecated',
	'meta_value' => '4.9.0',
);

$deprecated_query = new WP_Query($args);

This pull request also assigns a deprecated @since version term to imported (deprecated) posts.
See ticket #3699

This allows for deprecated posts to also be included in the since archives. Some deprecated versions (in the source code DocBlocks) are not correctly formatted. That's why a new function maybe_version() is used to do a very minimal check before assigning term and meta versions.

Without this pull request 95 @since terms are imported (WP 4.9.8)
The same number is imported with the maybe_version() check only added to the import of normal @since terms.
With this pull request 97 @since terms are imported.

This means 2 extra @since version terms (3.4.1 and mu) are imported for deprecated versions.

Note This pull request is a copy of the closed pull request #205 as I had to move the changes to its own branch

@keesiemeijer keesiemeijer changed the title Add filters to exclude directories and files before import Add introduced, modified and deprecated version post meta to imported posts Jan 30, 2019
@pbiron
Copy link

pbiron commented Jan 30, 2019

@keesiemeijer thanx for moving this forward!

[and you beat me to it: I was just going to ask if the title of this PR was a copy-paste error from your previous one :-)]

@keesiemeijer
Copy link
Contributor Author

Yeah, something went wrong with moving this PR to it's own branch 😄

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.

2 participants