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 WP-CLI commands - shared-counts display, shared-counts popular, shared-counts update #99

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

richardbuff
Copy link

Add WP-CLI functionality

wp shared-counts display 123
Display shares for single post

wp shared-counts popular --count=100
Display most popular posts

wp shared-counts update 123
Update share counts for a single post

Screencast of these three commands in action:

https://share.getcloudapp.com/z8ux9L4D

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (modification of the currently available functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project (WordPress coding standards, etc).
  • My code has appropriate phpdoc comments with a description, @since, @params and @return.
  • My code is tested for both new installs and for users that are upgrading from older versions.

@billerickson
Copy link
Collaborator

Looks great to me! Here are some recommended changes:

  • Change wp shared-counts display to wp shared-counts get
  • In the popular subcommand, set the default posts_per_page to 20, matching the dashboard widget
  • In the popular subcommand, make the first column Post ID and the second column Title
  • Consider using the table output style for the get and update subcommands, matching the popular one.

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