phpdoc-parser
phpdoc-parser copied to clipboard
Add introduced, modified and deprecated version post meta to imported posts
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 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 :-)]
Yeah, something went wrong with moving this PR to it's own branch 😄