Skip to content

Commit 8c346ab

Browse files
authored
Merge pull request #16 from iamapinan/dev
Add support for version wp early than 5.2.
2 parents d2966ee + e0257bf commit 8c346ab

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ You can edit the term page and publish on your website with elegant and powerful
6969

7070
### Changelogs
7171

72+
#### 1.0.5
73+
* Add support for version wp early than 5.2.
74+
7275
#### 1.0.4
7376
* Fix conflict with woo-line-notify plugin
7477

pdpa-consent.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/*
66
Plugin Name: PDPA Consent
77
Description: PDPA Consent allows you to notify to the user to accept privacy terms. Comply with Thailand PDPA law.
8-
Version: 1.0.4
8+
Version: 1.0.5
99
Author: Apinan Woratrakun, Aeknarin Sirisub
1010
Author URI: https://www.ioblog.me
1111
Plugin URI: https://github.com/iamapinan/PDPA-Consent
@@ -59,8 +59,16 @@ public function __construct()
5959
public function initial()
6060
{
6161
register_activation_hook( __FILE__, array( $this, 'plugin_activate' ));
62+
/**
63+
* Add support for version wp early than 5.2.
64+
*/
65+
if (function_exists('wp_body_open')) {
66+
add_action('wp_body_open', array($this, 'add_consent'));
67+
} else {
68+
add_action('wp_footer', array($this, 'add_consent'));
69+
}
70+
6271
add_filter('body_class', array( $this, 'change_body_class' ));
63-
add_action('wp_body_open', array($this, 'add_consent'));
6472
add_action('wp_ajax_pdpa_action', array( $this, 'pdpa_action' ));
6573
add_action('wp_enqueue_scripts', array( $this, 'pdpa_enqueue_scripts' ));
6674
add_filter('manage_users_columns', array( $this, 'pdpa_add_user_columns' ));

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: pdpa, gdpr, pdpa-consent, cookie, notice, notification, notify, cookie, co
55
Requires at least: 4.3
66
Requires PHP: 5.4.6
77
Tested up to: 5.4.1
8-
Stable tag: 1.0.4
8+
Stable tag: 1.0.5
99
License: GNU 3.0
1010
License URI: https://opensource.org/licenses/lgpl-3.0.html
1111

@@ -93,6 +93,9 @@ No questions yet.
9393

9494
== Changelog ==
9595

96+
= 1.0.5 =
97+
* Add support for version wp early than 5.2.
98+
9699
= 1.0.4 =
97100
* Fix conflict with woo-line-notify plugin
98101

0 commit comments

Comments
 (0)