Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbahl committed Jun 6, 2017
1 parent 5cf9d14 commit 4ae9dfe
Showing 1 changed file with 52 additions and 2 deletions.
54 changes: 52 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,54 @@
WP Term Timestamps
# WP Term Timestamps

This is a simple plugin that records timestamps when terms are created or modified, and the ID of the user who made the
modification.
modification.

### Term Creation
Whenever a term is created the following data will be stored in the term's term_meta:

Terms that were created before this plugin was activated will, of course, not have this meta stored.

* **meta_key:** `created`
* **meta_value:** array which includes timestamp and the user ID for the user who created the term

### Term Updates
Whenever a term is updated, the following data will be stored in the term's term_meta:

* **meta_key:** `modified`
* **meta_value:** array which includes timestamp and the user ID for the user who modified the term

### WPGraphQL Support

This plugin provides support for WPGraphQL (https://github.com/wp-graphql/wp-graphql)

When querying terms, the termObjects now have a `created` and `modified` field.

Here is an example GraphQL query that would work with WPGraphQL and this plugin active.

```
query {
categories {
id
link
name
created {
time
user {
id
username
}
}
modified {
time
user {
id
username
}
}
}
}
```

### Unit Tests
This plugin has Unit Tests. To run the tests, in the command line navigate to the plugin directory and run `phpunit`

0 comments on commit 4ae9dfe

Please sign in to comment.