Skip to content

Commit

Permalink
Fixed PHP undefined index error
Browse files Browse the repository at this point in the history
  • Loading branch information
samiahmedsiddiqui committed Jul 16, 2017
1 parent cfea5a9 commit 0b0de79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 7 additions & 3 deletions permalinks-customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Plugin Name: Permalinks Customizer
* Version: 0.3.2
* Version: 0.3.3
* Plugin URI: https://wordpress.org/plugins/permalinks-customizer/
* Description: Set permalinks for default post-type and custom post-type which can be changed from the single post edit page.
* Author: Sami Ahmed Siddiqui
Expand Down Expand Up @@ -492,8 +492,12 @@ function permalinks_customizer_trailingslash($string, $type) {
if ( !trim($request) ) return $string;

if ( trim($_CPRegisteredURL,'/') == trim($request,'/') ) {
return ($string{0} == '/' ? '/' : '') . trailingslashit($url['path']) . $_CPRegisteredURL;
}
if( isset($url['path']) ){
return ($string{0} == '/' ? '/' : '') . trailingslashit($url['path']) . $_CPRegisteredURL;
}else{
return ($string{0} == '/' ? '/' : '') . $_CPRegisteredURL;
}
}
return $string;
}

Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
Tags: address, category, custom, custom permalink, custom post permalinks, link, permalink, rewrite slug, redirects, slug, tags, url
Requires at least: 3.5
Tested up to: 4.5
Stable tag: 0.3.2
Stable tag: 0.3.3

Set permalinks for default post-type and custom post-type which can be changed from the single post edit page.

Expand Down Expand Up @@ -90,6 +90,10 @@ A. No, This plugin does not work with [custom permalinks](https://wordpress.org/

== Changelog ==

= 0.3.3 =

* Fixed PHP undefined index error

= 0.3.2 =

* Convert custom permalink to permalink customizer
Expand Down

0 comments on commit 0b0de79

Please sign in to comment.