Auto Terms of Service and Privacy Policy - Version 2.0.2

Version Description

Download this release

Release Info

Developer wpautoterms
Plugin Icon 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 CHANGED
@@ -71,12 +71,14 @@ class Legal_Page {
71
  return sanitize_text_field( $s );
72
  }
73
  $r = array();
74
- foreach ( $s as $k => $v ) {
75
- // NOTE: forbid nested arrays
76
- if ( is_array( $v ) ) {
77
- $r[ $k ] = '';
78
- } else {
79
- $r[ $k ] = sanitize_text_field( $v );
 
 
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
- foreach ( $posts as $post ) {
36
- if ( $post->post_modified == $post->post_date ) {
37
- continue;
38
- }
39
- $t = get_post_modified_time( get_option( 'date_format' ), false, $post, true );
40
- if ( ! isset( $this->_posts[ $t ] ) ) {
41
- $this->_posts[ $t ] = array();
 
 
 
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
- $this->_tags = array_combine(
22
- array_map( function ( $x ) {
23
- return $x->term_id;
24
- }, $tags ),
25
- array_map( function ( $x ) {
26
- return $x->name;
27
- }, $tags ) );
 
 
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.1
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
- foreach ( $values as $k => $v ) {
7
- $k = trim( $k );
8
- if ( trim( $k ) == $value ) {
9
- $selected = ' selected="selected"';
10
- $found = true;
11
- } else {
12
- $selected = '';
 
 
 
 
 
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>