Auto Terms of Service and Privacy Policy - Version 2.1.8

Version Description

Download this release

Release Info

Developer wpautoterms
Plugin Icon Auto Terms of Service and Privacy Policy
Version 2.1.8
Comparing to
See all releases

Code changes from version 2.1.7 to 2.1.8

README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: gdpr, privacy policy, terms and conditions, terms of service, terms of use
4
  Requires at least: 4.2
5
  Tested up to: 4.9.7
6
  Requires PHP: 5.3
7
- Stable tag: 2.1.7
8
  License: GPL version 3 or any later version
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -113,6 +113,10 @@ Installing the plugin is easy. Just follow these steps:
113
 
114
  == Changelog ==
115
 
 
 
 
 
116
  = Version 2.1.7 =
117
  * Sep 3, 2018
118
  * Bugfix for user roles capabilities
4
  Requires at least: 4.2
5
  Tested up to: 4.9.7
6
  Requires PHP: 5.3
7
+ Stable tag: 2.1.8
8
  License: GPL version 3 or any later version
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
113
 
114
  == Changelog ==
115
 
116
+ = Version 2.1.8 =
117
+ * Sep 9, 2018
118
+ * Bugfix for loading plugin scripts regardless of third party scripts
119
+
120
  = Version 2.1.7 =
121
  * Sep 3, 2018
122
  * Bugfix for user roles capabilities
auto-terms-of-service-privacy-policy.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://wpautoterms.com
5
  Description: Create Privacy Policy (Simple or GDPR), Terms & Conditions, Disclaimers and more. Compliance Kits to help you be compliant with the law.
6
  Author: WP AutoTerms
7
  Author URI: https://wpautoterms.com
8
- Version: 2.1.7
9
  License: GPLv2 or later
10
  Text Domain: wpautoterms
11
  Domain Path: /languages
5
  Description: Create Privacy Policy (Simple or GDPR), Terms & Conditions, Disclaimers and more. Compliance Kits to help you be compliant with the law.
6
  Author: WP AutoTerms
7
  Author URI: https://wpautoterms.com
8
+ Version: 2.1.8
9
  License: GPLv2 or later
10
  Text Domain: wpautoterms
11
  Domain Path: /languages
includes/admin/admin.php CHANGED
@@ -42,7 +42,7 @@ abstract class Admin {
42
 
43
  public static function action_init() {
44
  add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) );
45
- add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
46
  add_filter( 'post_row_actions', array( __CLASS__, 'row_actions' ), 10, 2 );
47
  add_filter( 'pre_update_option', array( __CLASS__, 'fix_update' ), 10, 3 );
48
  add_filter( 'get_sample_permalink_html', array( __CLASS__, 'remove_permalink' ), 10, 5 );
@@ -138,6 +138,18 @@ abstract class Admin {
138
  public static function enqueue_scripts( $page ) {
139
  global $post;
140
  if ( ! empty( $post ) && ( $post->post_type == WPAUTOTERMS_CPT ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
141
  if ( $page == 'edit.php' ) {
142
  wp_enqueue_script( WPAUTOTERMS_SLUG . '_row_actions', WPAUTOTERMS_PLUGIN_URL . 'js/row-actions.js',
143
  false, false, true );
42
 
43
  public static function action_init() {
44
  add_action( 'add_meta_boxes', array( __CLASS__, 'add_meta_boxes' ) );
45
+ add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ), 100 );
46
  add_filter( 'post_row_actions', array( __CLASS__, 'row_actions' ), 10, 2 );
47
  add_filter( 'pre_update_option', array( __CLASS__, 'fix_update' ), 10, 3 );
48
  add_filter( 'get_sample_permalink_html', array( __CLASS__, 'remove_permalink' ), 10, 5 );
138
  public static function enqueue_scripts( $page ) {
139
  global $post;
140
  if ( ! empty( $post ) && ( $post->post_type == WPAUTOTERMS_CPT ) ) {
141
+ // NOTE: load media scripts in case 3-rd party plugin fails to enqueue them properly.
142
+ $scripts = wp_scripts();
143
+ if ( ! empty( $scripts->queue ) ) {
144
+ $cmp = 'media-';
145
+ $cmp_len = strlen( $cmp );
146
+ foreach ( $scripts->queue as $item ) {
147
+ if ( strncasecmp( $item, $cmp, $cmp_len ) ) {
148
+ wp_enqueue_media();
149
+ break;
150
+ }
151
+ }
152
+ }
153
  if ( $page == 'edit.php' ) {
154
  wp_enqueue_script( WPAUTOTERMS_SLUG . '_row_actions', WPAUTOTERMS_PLUGIN_URL . 'js/row-actions.js',
155
  false, false, true );
includes/cpt/cpt.php CHANGED
@@ -79,7 +79,7 @@ abstract class CPT {
79
  $args = array(
80
  'labels' => $labels,
81
  'hierarchical' => true,
82
- 'supports' => array( 'title', 'editor', 'revisions', 'page-attributes' ),
83
  'public' => true,
84
  'show_ui' => true,
85
  //'show_in_nav_menus' => false,
79
  $args = array(
80
  'labels' => $labels,
81
  'hierarchical' => true,
82
+ 'supports' => array( 'title', 'editor', 'revisions', 'page-attributes', 'custom-fields' ),
83
  'public' => true,
84
  'show_ui' => true,
85
  //'show_in_nav_menus' => false,