Code Suggestion
-
I wanted to suggest a code edit, but I’m not sure if the source has a public repo.
In either case, I noticed that
event_pageview()has no args passed to it. This is unfortunate because I think most people, me included, want to know which page has been viewed.I suggest editing the code to get access to the wp_query:
public function event_pageview(){ global $wp_query; $this->assemble_mqtt_message( 'event_pageview', (array) $wp_query ); }Another suggestion is to also use
replace_placeholdersin the topic. This way we can have a different subtopic depending on which page is actually viewed. This is easily achieved by adding:topic = $this->replace_placeholders( $topic, $args );in theassemble_mqtt_message()function.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Code Suggestion’ is closed to new replies.