Version Description
Download this release
Release Info
Developer | wpautoterms |
Plugin | Auto Terms of Service and Privacy Policy |
Version | 2.0.2 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.0.2
- includes/admin/form/legal-page.php +8 -6
- includes/frontend/notice/update-notice.php +10 -8
- includes/option/tag-option.php +9 -7
- readme.txt +5 -1
- templates/options/tag-option.php +12 -10
includes/admin/form/legal-page.php
CHANGED
@@ -71,12 +71,14 @@ class Legal_Page {
|
|
71 |
return sanitize_text_field( $s );
|
72 |
}
|
73 |
$r = array();
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
80 |
}
|
81 |
}
|
82 |
|
71 |
return sanitize_text_field( $s );
|
72 |
}
|
73 |
$r = array();
|
74 |
+
if ( ! empty( $s ) ) {
|
75 |
+
foreach ( $s as $k => $v ) {
|
76 |
+
// NOTE: forbid nested arrays
|
77 |
+
if ( is_array( $v ) ) {
|
78 |
+
$r[ $k ] = '';
|
79 |
+
} else {
|
80 |
+
$r[ $k ] = sanitize_text_field( $v );
|
81 |
+
}
|
82 |
}
|
83 |
}
|
84 |
|
includes/frontend/notice/update-notice.php
CHANGED
@@ -32,15 +32,17 @@ class Update_Notice extends Base_Notice {
|
|
32 |
|
33 |
$posts = get_posts( $args );
|
34 |
$this->_posts = array();
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
$this->_posts[ $t ]
|
|
|
|
|
|
|
42 |
}
|
43 |
-
$this->_posts[ $t ][] = $post;
|
44 |
}
|
45 |
}
|
46 |
|
32 |
|
33 |
$posts = get_posts( $args );
|
34 |
$this->_posts = array();
|
35 |
+
if ( count( $posts ) ) {
|
36 |
+
foreach ( $posts as $post ) {
|
37 |
+
if ( $post->post_modified == $post->post_date ) {
|
38 |
+
continue;
|
39 |
+
}
|
40 |
+
$t = get_post_modified_time( get_option( 'date_format' ), false, $post, true );
|
41 |
+
if ( ! isset( $this->_posts[ $t ] ) ) {
|
42 |
+
$this->_posts[ $t ] = array();
|
43 |
+
}
|
44 |
+
$this->_posts[ $t ][] = $post;
|
45 |
}
|
|
|
46 |
}
|
47 |
}
|
48 |
|
includes/option/tag-option.php
CHANGED
@@ -18,13 +18,15 @@ class Tag_Option extends Option {
|
|
18 |
public function tags() {
|
19 |
if ( empty( $this->_tags ) ) {
|
20 |
$tags = get_terms( 'post_tag', array( 'hide_empty' => false ) );
|
21 |
-
$
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
28 |
}
|
29 |
|
30 |
return $this->_tags;
|
18 |
public function tags() {
|
19 |
if ( empty( $this->_tags ) ) {
|
20 |
$tags = get_terms( 'post_tag', array( 'hide_empty' => false ) );
|
21 |
+
if ( count( $tags ) ) {
|
22 |
+
$this->_tags = array_combine(
|
23 |
+
array_map( function ( $x ) {
|
24 |
+
return $x->term_id;
|
25 |
+
}, $tags ),
|
26 |
+
array_map( function ( $x ) {
|
27 |
+
return $x->name;
|
28 |
+
}, $tags ) );
|
29 |
+
}
|
30 |
}
|
31 |
|
32 |
return $this->_tags;
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: wpautoterms
|
|
3 |
Tags: gdpr, privacy policy, terms and conditions, terms of service, terms of use, disclosure, disclaimer, affiliate, cookies, cookie consent, legal
|
4 |
Requires at least: 4.2
|
5 |
Tested up to: 4.9.7
|
6 |
-
Stable tag: 2.0.
|
7 |
License: GPL version 3 or any later version
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -112,6 +112,10 @@ Installing the plugin is easy. Just follow these steps:
|
|
112 |
|
113 |
== Changelog ==
|
114 |
|
|
|
|
|
|
|
|
|
115 |
= Version 2.0.1 =
|
116 |
* Aug 1, 2018
|
117 |
* Bugfixes for version 2.0.0
|
3 |
Tags: gdpr, privacy policy, terms and conditions, terms of service, terms of use, disclosure, disclaimer, affiliate, cookies, cookie consent, legal
|
4 |
Requires at least: 4.2
|
5 |
Tested up to: 4.9.7
|
6 |
+
Stable tag: 2.0.2
|
7 |
License: GPL version 3 or any later version
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
112 |
|
113 |
== Changelog ==
|
114 |
|
115 |
+
= Version 2.0.2 =
|
116 |
+
* Aug 1, 2018
|
117 |
+
* Bugfixes for version 2.0.1
|
118 |
+
|
119 |
= Version 2.0.1 =
|
120 |
* Aug 1, 2018
|
121 |
* Bugfixes for version 2.0.0
|
templates/options/tag-option.php
CHANGED
@@ -3,17 +3,19 @@
|
|
3 |
id="<?php echo $name; ?>[]">
|
4 |
<?php
|
5 |
$found = false;
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
$
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
-
?>
|
15 |
-
<option value="<?php echo esc_attr( $k ); ?>"<?php echo $selected; ?>><?php echo esc_html( $v ); ?></option>
|
16 |
-
<?php
|
17 |
}
|
18 |
?>
|
19 |
<option value="0"><?php _e( 'new tag...', WPAUTOTERMS_SLUG ); ?></option>
|
3 |
id="<?php echo $name; ?>[]">
|
4 |
<?php
|
5 |
$found = false;
|
6 |
+
if ( ! empty( $values ) ) {
|
7 |
+
foreach ( $values as $k => $v ) {
|
8 |
+
$k = trim( $k );
|
9 |
+
if ( trim( $k ) == $value ) {
|
10 |
+
$selected = ' selected="selected"';
|
11 |
+
$found = true;
|
12 |
+
} else {
|
13 |
+
$selected = '';
|
14 |
+
}
|
15 |
+
?>
|
16 |
+
<option value="<?php echo esc_attr( $k ); ?>"<?php echo $selected; ?>><?php echo esc_html( $v ); ?></option>
|
17 |
+
<?php
|
18 |
}
|
|
|
|
|
|
|
19 |
}
|
20 |
?>
|
21 |
<option value="0"><?php _e( 'new tag...', WPAUTOTERMS_SLUG ); ?></option>
|