-
-
Notifications
You must be signed in to change notification settings - Fork 179
Conversation
add_filter('soil/dummyGA', '__return_false'); // Appends H5BP's GA snippet | ||
``` | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👮 remove one of these lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's basically the same as what's already in the README for that part:
https://github.com/roots/soil#google-analytics
Note that I have the filter there twice as well with the comments on the right.
I don't mind removing one, but I left it there so that it would clarify exactly what true and false mean in the filter.
*/ | ||
function google_analytics() { | ||
if (!defined('GOOGLE_ANALYTICS_ID') || !GOOGLE_ANALYTICS_ID) { | ||
list($ga_id, $hook) = $options + ['','wp_footer']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space after comma?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dun
My feedback for some readability tweaks: https://gist.github.com/swalkinshaw/ff3b45c4bf164a3d4573 |
👍 |
if (isset(self::$modules[$module])) { | ||
return self::$modules[$module]->options; | ||
} | ||
if (substr($module, 0, 5)!=='soil-') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should have triggered a fail on phpcs :(
will merge after it passes after the latest phpcs change (#60) |
Add options for Google Analytics
By default, the script will be loaded from the
wp_footer
hook, but you can specify any other action hook as the third parameter.I also changed the way the filter works. Instead of the filter being
soil/displayGA
, it's nowsoil/dummyGA
and returningtrue
will use the dummyga()
function whilefalse
will load H5BP's snippet.