Custom Permalinks - Version 1.2.24

Version Description

  • May 31, 2018 =

    • Bug
    • FATAL ERROR when the administrator role not found
Download this release

Release Info

Developer sasiddiqui
Plugin Icon Custom Permalinks
Version 1.2.24
Comparing to
See all releases

Code changes from version 1.2.23 to 1.2.24

Files changed (3) hide show
  1. custom-permalinks.php +16 -5
  2. readme.txt +6 -1
  3. uninstall.php +12 -2
custom-permalinks.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Custom Permalinks
4
  * Plugin URI: https://wordpress.org/plugins/custom-permalinks/
5
  * Description: Set custom permalinks on a per-post basis
6
- * Version: 1.2.23
7
  * Author: Sami Ahmed Siddiqui
8
  * Author URI: https://www.custompermalinks.com/
9
  * Donate link: https://www.paypal.me/yasglobal
@@ -16,7 +16,7 @@
16
  */
17
 
18
  /**
19
- * Custom Permalinks - Update Permalinks of Post/Pages
20
  * Copyright 2008-2018 Sami Ahmed Siddiqui <sami.siddiqui@yasglobal.com>
21
  *
22
  * This program is free software: you can redistribute it and/or modify
@@ -64,7 +64,7 @@ class Custom_Permalinks {
64
  }
65
 
66
  if ( ! defined( 'CUSTOM_PERMALINKS_PLUGIN_VERSION' ) ) {
67
- define( 'CUSTOM_PERMALINKS_PLUGIN_VERSION', '1.2.23' );
68
  }
69
 
70
  if ( ! defined( 'CUSTOM_PERMALINKS_PATH' ) ) {
@@ -115,8 +115,19 @@ class Custom_Permalinks {
115
  */
116
  public static function plugin_activate() {
117
  $role = get_role( 'administrator' );
118
- $role->add_cap( 'cp_view_post_permalinks' );
119
- $role->add_cap( 'cp_view_category_permalinks' );
 
 
 
 
 
 
 
 
 
 
 
120
  }
121
 
122
  /**
3
  * Plugin Name: Custom Permalinks
4
  * Plugin URI: https://wordpress.org/plugins/custom-permalinks/
5
  * Description: Set custom permalinks on a per-post basis
6
+ * Version: 1.2.24
7
  * Author: Sami Ahmed Siddiqui
8
  * Author URI: https://www.custompermalinks.com/
9
  * Donate link: https://www.paypal.me/yasglobal
16
  */
17
 
18
  /**
19
+ * Custom Permalinks - Update Permalinks of Post/Pages and Categories
20
  * Copyright 2008-2018 Sami Ahmed Siddiqui <sami.siddiqui@yasglobal.com>
21
  *
22
  * This program is free software: you can redistribute it and/or modify
64
  }
65
 
66
  if ( ! defined( 'CUSTOM_PERMALINKS_PLUGIN_VERSION' ) ) {
67
+ define( 'CUSTOM_PERMALINKS_PLUGIN_VERSION', '1.2.24' );
68
  }
69
 
70
  if ( ! defined( 'CUSTOM_PERMALINKS_PATH' ) ) {
115
  */
116
  public static function plugin_activate() {
117
  $role = get_role( 'administrator' );
118
+ if ( ! empty( $role ) ) {
119
+ $role->add_cap( 'cp_view_post_permalinks' );
120
+ $role->add_cap( 'cp_view_category_permalinks' );
121
+ }
122
+
123
+ add_role(
124
+ 'custom_permalinks_manager',
125
+ __( 'Custom Permalinks Manager' ),
126
+ array(
127
+ 'cp_view_post_permalinks' => true,
128
+ 'cp_view_category_permalinks' => true
129
+ )
130
+ );
131
  }
132
 
133
  /**
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/yasglobal
4
  Tags: permalink, url, link, address, custom, redirect, custom post type, GDPR, GDPR Compliant
5
  Requires at least: 2.6
6
  Tested up to: 4.9
7
- Stable tag: 1.2.23
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl.html
10
 
@@ -97,6 +97,11 @@ This process defines you the steps to follow either you are installing through W
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
100
  = 1.2.23 - May 22, 2018 =
101
 
102
  * Enhancement
4
  Tags: permalink, url, link, address, custom, redirect, custom post type, GDPR, GDPR Compliant
5
  Requires at least: 2.6
6
  Tested up to: 4.9
7
+ Stable tag: 1.2.24
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl.html
10
 
97
 
98
  == Changelog ==
99
 
100
+ = 1.2.24 - May 31, 2018 =
101
+
102
+ * Bug
103
+ * [FATAL ERROR when the administrator role not found](https://wordpress.org/support/topic/fatal-error-on-update-15/)
104
+
105
  = 1.2.23 - May 22, 2018 =
106
 
107
  * Enhancement
uninstall.php CHANGED
@@ -16,8 +16,18 @@ delete_post_meta_by_key( 'custom_permalink' );
16
  delete_option( 'custom_permalink_table' );
17
 
18
  $role = get_role( 'administrator' );
19
- $role->remove_cap( 'cp_view_post_permalinks' );
20
- $role->remove_cap( 'cp_view_category_permalinks' );
 
 
 
 
 
 
 
 
 
 
21
 
22
  // Clear any cached data that has been removed
23
  wp_cache_flush();
16
  delete_option( 'custom_permalink_table' );
17
 
18
  $role = get_role( 'administrator' );
19
+ if ( ! empty( $role ) ) {
20
+ $role->remove_cap( 'cp_view_post_permalinks' );
21
+ $role->remove_cap( 'cp_view_category_permalinks' );
22
+ }
23
+
24
+ $role = get_role( 'custom_permalinks_manager' );
25
+ if ( ! empty( $role ) ) {
26
+ $role->remove_cap( 'cp_view_post_permalinks' );
27
+ $role->remove_cap( 'cp_view_category_permalinks' );
28
+
29
+ remove_role( 'custom_permalinks_manager' );
30
+ }
31
 
32
  // Clear any cached data that has been removed
33
  wp_cache_flush();