Skip to content

Search: Add plugin or theme's URL on wordpress.org#108

Merged
schlessera merged 3 commits intowp-cli:masterfrom
GaryJones:feature/94-url
Jul 26, 2018
Merged

Search: Add plugin or theme's URL on wordpress.org#108
schlessera merged 3 commits intowp-cli:masterfrom
GaryJones:feature/94-url

Conversation

@GaryJones
Copy link
Contributor

After the plugin_api() or theme_api() call is made, update the results with the generated URL for wordpress.org, made up of a hard-coded domain name, the plural of the item type, and the item's slug.

Fixes #94.

* **icons**: Plugin's Icon Image Link
* **active_installs**: Plugin's Number of Active Installs
* **contributors**: Plugin's List of Contributors
* **url**: Plugin's URL on wordpress.org
Copy link
Member

Choose a reason for hiding this comment

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

CS: There's a trailing space here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Fixed in the rebased 26862c0.


// Add `url` for plugin or theme on wordpress.org.
foreach ( $items as $index => $item_object ) {
$item_object->url = 'https://wordpress.org/' . $plural . '/' . $item_object->slug . '/';
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer this to use substitution:

$item_object->url = "https://wordpress.org/{$plural}/{$item_object->slug}/";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched in the rebased 26862c0.

After the plugin_api() or theme_api() call is made, update the results with the generated URL for wordpress.org, made up of a hard-coded domain name, the plural of the item type, and the item's slug.

Fixes #94.
@schlessera schlessera added command:plugin-search Related to 'plugin search' command command:theme-search Related to 'theme search' command labels Jul 20, 2018
@schlessera schlessera modified the milestones: 1.2.0, 1.2.1 Jul 20, 2018
@schlessera
Copy link
Member

This currently fails on WP trunk: https://travis-ci.org/wp-cli/extension-command/jobs/406130240#L665-L704

I assume the plugins_api() function has changed.

@GaryJones
Copy link
Contributor Author

This currently fails on WP trunk

Trying a workaround first.

@schlessera schlessera modified the milestones: 1.2.1, 1.2.2 Jul 25, 2018
@schlessera schlessera merged commit faa452b into wp-cli:master Jul 26, 2018
@schlessera
Copy link
Member

Thanks for the pull request, @GaryJones !

@GaryJones GaryJones deleted the feature/94-url branch July 27, 2018 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:plugin-search Related to 'plugin search' command command:theme-search Related to 'theme search' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants