-
Notifications
You must be signed in to change notification settings - Fork 116
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
Could someone please provide a quick example how to record this action? #842
Comments
Hi @netconstructor . Lack of good docs is a very real problem. We're trying to find the time to prioritise it, amongst other things. See these related issues: #819, #821 In terms of a starting place, I would recommend having a look at how the Media connector works: Basically you need the following properties: And the following methods: Then, for each of the actions in your
Finally, register your connector class by filtering I hope that's enough to get you started. Let me know how you go, and if you need any help. |
Hi Luke, how do I register connector. I have created a custom connector class and followed the steps given in the wiki of creating custom connecor. Unable to register the connector. What do you mean by To register a Connector, hook into the wp_stream_connectors filter from inside your plugin. |
Example <?php
/**
* Stream integration
*
* @package Integrations
* @see https://github.com/xwp/stream/wiki/Creating-a-Custom-Connector#registering-a-connector
* @since 2017.12.22
*/
namespace Integrations;
defined( 'ABSPATH' ) || exit;
/**
* Main class
*/
class Stream {
/**
* Constructor
*/
public function __construct() {
$this->init();
}
/**
* Init
*/
private function init() {
add_filter( 'wp_stream_connectors', function( $classes ) {
$classes['posts-viewed'] = new Stream\ConnectorPostsViewed();
return $classes;
} );
}
} |
This is the third time over the past year I have come back to this plugin, primarily due to its slick visual organization while meeting nearly 98% of my requirements. The problem I am having here is that I simply can't figure out the proper method to create a custom action trigger entry for my specific situation.
Let me point out in advance that I am well aware that what I aim to track would likely be incapable of scaling properly to more than a few concurrent users at a time and this is perfectly fine for my situation... I simply need a basic example of how it can be done.
The nature of my situation involves a custom wordpress website which is only accessible to about 50 individuals each of which need an existing pre approved wp user account to access the site. What I need to be able to do here is simply record every single page view on this domain for each of these users. Ideally I would like the information which gets recorded to include very basic information including date/timestamp, page title, post type name, any associated categories, tags, taxonomies and potentially some specific custom field value. The purpose of these logged pageviews simply need to allow the user to view his own activity and filter/sort it and allow an admin to do the same for all or a single user.
Could someone who has some basic experience with this plugin please provide a basic example of how to achieve this basic functionality?
Thanks in advance!
The text was updated successfully, but these errors were encountered: