-
Notifications
You must be signed in to change notification settings - Fork 2
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
Updated CookieConsent to version 3.0.0. and some minor updates #4
base: master
Are you sure you want to change the base?
Changes from all commits
b570a9c
0aa85af
469621a
b45e823
3c3dfb7
d0feb4d
3e597cf
57c7029
fba2228
39c8744
3857067
470fa0a
6b33980
ccaa0b3
f289561
ce1baad
04e0f78
ea2c77c
37ddc11
f67e281
646a799
00b1908
775c95e
16a517b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
* Tested up to: 6.4.3 | ||
* License: GPL-3.0+ | ||
* License URI: https://www.gnu.org/licenses/gpl-3.0.html | ||
* @Modified by: Jesse Raitapuro (Digiaargh) | ||
* @Modified time: 2024-04-22 16:30:00 | ||
* | ||
* @package air-cookie | ||
*/ | ||
|
@@ -46,7 +48,7 @@ function get_database_version() { | |
* @since 0.1.0 | ||
*/ | ||
function get_script_version() { | ||
return '2.9.1'; | ||
return '3.0.0'; | ||
} // end get_script_version | ||
|
||
/** | ||
|
@@ -57,12 +59,12 @@ function get_script_version() { | |
require 'plugin-helpers.php'; | ||
|
||
/** | ||
* Github updater. | ||
* Github updater. Disabled by commenting out. | ||
* | ||
* @since 0.1.0 | ||
*/ | ||
require plugin_base_path() . '/plugin-update-checker/plugin-update-checker.php'; | ||
$update_checker = \Puc_v4_Factory::buildUpdateChecker( 'https://github.com/digitoimistodude/air-cookie', __FILE__, 'air-cookie' ); | ||
// require plugin_base_path() . '/plugin-update-checker/plugin-update-checker.php'; | ||
// $update_checker = \Puc_v4_Factory::buildUpdateChecker( 'https://github.com/digitoimistodude/air-cookie', __FILE__, 'air-cookie' ); | ||
Comment on lines
61
to
+67
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These kinds of changes shouldn't be included in PRs 😃 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was meant for local only 🤦♂️ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Haha, happens to the best of us. |
||
|
||
/** | ||
* Compile settings for the script. | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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 would be
air_cookie\categories\analytics
, without the braces.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.
Hmm I can´t get it to work without brackets. Only way to use the filter without brackets would require to change in settings.php:
$categories[ $key ] = apply_filters( "air_cookie\categories\{$category_key}", $category );
to
$categories[ $key ] = apply_filters( "air_cookie\categories\\{$category_key}", $category );
Atleast that´s how PHP-docs say to handle backslashed variables 🤔
// Won't work, outputs: C:\folder\{fantastic}.txt
echo "C:\folder\{$great}.txt"
// Works, outputs: C:\folder\fantastic.txt
echo "C:\\folder\\{$great}.txt"
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.
Not in the code, I meant in the example 😄
If user wants to filter analytics they need to create a filter
add_filter ( 'air_cookie\categories\analytics', 'my_change_analytics' );
, which is then called byapply_filters( "air_cookie\categories\{$category_key}", $category );
."air_cookie\categories\{$category_key}"
gets resolved to"air_cookie\categories\analytics
as{$category_key}
is a string template.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 is indeed a bug. #10