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

Query Reference documentation wrong #847

Closed
twiginteractive opened this issue May 10, 2016 · 8 comments
Closed

Query Reference documentation wrong #847

twiginteractive opened this issue May 10, 2016 · 8 comments

Comments

@twiginteractive
Copy link

twiginteractive commented May 10, 2016

I'm new to Stream, so was reading the Wiki - looks like it is way out of date. The Query Reference page mentions a class (and function name wp_stream_query) that doesn't exist

https://github.com/xwp/stream/wiki/Query-Reference

Where should I be looking for up-to-date dox?

@lukecarbis
Copy link
Contributor

You're right that they're out of date. We need to update them. I'll bump the priority.

Depending on what you're making, I can point you to an example. This extension is a great example of how to use Stream records elsewhere: https://github.com/Japh/stream-to-papertrail

And you can use this class as an example for how a connector (for adding new entries to Stream) works: https://github.com/xwp/stream/blob/develop/connectors/class-connector-media.php

See #818 and #819.

@twiginteractive
Copy link
Author

Thanks Luke -

Here's a quick synopsis of what I'm hoping to achieve with Stream: create a simple front-end 'audit' log of certain actions performed by certain users/Roles. For now, it's pretty simple data collection - I think the only extension I need to make is to record certain Post Meta info along with the core Stream meta (since Stream doesn't store WP object meta, correct?)

Then I need to query the Stream data to display on the front end - that's what I was looking for wp_stream_query - so can you point me to the correct syntax for this function? I can see the Query class in the WP_Stream namespace - I just can't figure out how to access that object from my functions.php.

Thanks!
(Also, is this the correct place for bug reports, or should it be in the Support forum on WP.org ?)

@lukecarbis
Copy link
Contributor

@twiginteractive Right - Stream doesn't store WP Object meta.

You can access the query method of the Query class like this:

$stream = wp_stream_get_instance();

$args = array();
$results = $stream->db->query( $args );

Yes, this is the right place for bug reports.

@twiginteractive
Copy link
Author

@lukecarbis Sweet - thanks so much for the quick reply!

@ishansharma
Copy link

@lukecarbis I ended up wasting 10-15 minutes wondering why the class wasn't there and the found this issue. Just put a small note in Wiki for anyone who follows it: https://github.com/xwp/stream/wiki/Query-Reference

I'd like to go ahead and update that page. Let me know if that's fine with you. Will try to stick to the existing style as much as possible.

@lukecarbis
Copy link
Contributor

@ishansharma Absolutely!

@lkraav
Copy link
Contributor

lkraav commented Dec 22, 2017

@ishansharma did that documentation update effort ever materialize? Seems like the wiki still lists the outdate wp_stream_query() function.

@pembo13
Copy link

pembo13 commented Mar 26, 2018

Just a heads up for anyone who found this, the docs are way off "author" isn't a valid field, nor is "author_meta".

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

No branches or pull requests

5 participants