Skip to content
heavybeard edited this page Jan 29, 2017 · 2 revisions

Commands » mycred » export

wp mycred export - Export Points Log

Quick links: myCRED_Query_Log, plugin wordpress page, plugin website, Github issues


OPTIONS

<output-file>
    The CSV file name.

[--user_id=<user_id>]
    Return the log entries of a specific user.

[--ctype=<ctype>]
    Show log entries of a specific cred type. Defaults to mycred_default.

[--number=<number>]
    Number of entires to return. Defaults to -1.

[--time=<time>]
    Return log entries according to one of the Time Filters. Available options are:
        today – show todays entries
        yesterday – show yesterdays entries
        thisweek – show this weeks entries
        thismonth – show this months entries
        from,to – Using Unix timestamps, entries logged between the two timestamps are returned. The two timestamps must be separated with a comma sign and nothing else.

[--ref=<ref>]
    Return log entries for a specific hook reference.

[--ref_id=<ref_id>]
    Return entires with a specific reference ID.

[--amount=<amount>]
    Return entries with a specific amount passed as a integer or float, or a range using an associative array. Required keys are: start (range start), end (range end) or if you want to make a comparison: num (the amount to compare to) and compare (=, LIKE, NOT LIKE etc.).

[--s=<s>]
    Return results with this search string. If the user_id is not used here, only the ref, ref_id and entry columns are searched.

[--orderby=<orderby>]
    Oder the results by a given column. Available columns are:
        id
        blog_id
        ref
        ref_id
        user_id
        creds
        ctype
        entry
        data
        time.
    Defaults to time.

[--order=<order>]
    Choice of ordering the result either Ascending (ASC) or Descending (DESC). Defaults to DESC.

[--ids]
    Choice of only returning the entry ids only (true) or all columns (false). Defaults to all columns (false).

[--unset=<unset>]
    List of columns (with coma ,) to remove from results

EXAMPLES

# Export all entries
$ wp mycred export filename
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export entries of a specific user
$ wp mycred export filename --user_id=1
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export the last 50 entries
$ wp mycred export filename --number=50
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export todays entries
$ wp mycred export filename --time=today
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export specific users entries from yesterday
$ wp mycred export filename --user_id=1 --time=yesterday
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export entries from imports
$ wp mycred export filename --red=import
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export transfers entries made to a specific user
$ wp mycred export filename --ref=transfer --ref_id=1
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export transfers entries made from one user to another
$ wp mycred export filename --user_id=1 --ref=transfer --ref_id=2
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export entries where 10 points were given
$ wp mycred export filename --amount=10
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export entries where points were between 10 and 20
$ wp mycred export filename --amount="start=10,end=20"
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export entries where points were anything but 20 points were given
$ wp mycred export filename --amount="num=20,compare=!="
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export all entries where the string foo is found
$ wp mycred export filename --s=foo
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export entries ordered by id
$ wp mycred export filename --orderby=id
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export for a given user in ascending order
$ wp mycred export filename --user_id=1 --order=ASC
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv

# Export only the entry ids for e specific user
$ wp mycred export filename --user_id=1 --ids
Success: myCRED log exported here /var/www/wp/wp-content/uploads/mycred/filename.csv
Clone this wiki locally