Hi Jeff.
I am not a WP expert, so apologies if I have it wrong…
I retested this issue.
– Installed BBQ (is installed in directory “block-bad-queries”)
– Install BBQ Block Count (is installed in directory “bbq-block-count”)
Checked the settings of BBQ: no count is displayed
I found that the change I mentioned earlier was not correct.
I actually changed the code in bbq-settings.php, bbq_maybe_display_count() to
if ( is_plugin_active( 'bbq-block-count/bbq-block-count.php' ) ) {
and now the counter is displayed.
I tested the response of
apply_filters('bbq_count_plugin_path', 'bbq-block-count.php')
And it returns “bbq-block-count.php” which is not the directory where the plugin is installed.
Digging into the documentation and it appears to be that if a filter is not not added to the code it simply returns the argument, in this case bbq-block-count.php
I guess there should be a “add_filter(…)” somewhere in the code but (default) it is not there.
So “is_plugin_active(‘bbq-block-count.php’)” will not return the correct value and assumes the plugin is not installed.
I ended up with this, which handles both situations (with and without filter):
if (is_plugin_active('bbq-block-count/bbq-block-count.php')
or is_plugin_active(apply_filters('bbq_count_plugin_path', 'bbq-block-count.php')) )
{...}
Hope I am correct?
Regards, hleenWP