FV Top Level Categories - Version 1.8

Version Description

Download this release

Release Info

Developer FolioVision
Plugin Icon 128x128 FV Top Level Categories
Version 1.8
Comparing to
See all releases

Code changes from version 1.7 to 1.8

Files changed (2) hide show
  1. readme.txt +6 -1
  2. top-level-cats.php +5 -5
readme.txt CHANGED
@@ -45,7 +45,12 @@ Make sure your categories have unique slugs - watch out for pages with the same
45
 
46
  == Changelog ==
47
 
48
- = Version 1.7- May 12th, 2014 =
 
 
 
 
 
49
 
50
  * Added Polish translation - thanks to maciejka45@gmail.com
51
  * Added Portuguese translation - thanks to Pedro Mendonça
45
 
46
  == Changelog ==
47
 
48
+ = Version 1.8 - May 22th, 2014 =
49
+
50
+ * Fix for paginated category archives when using custom pagination_base - thanks to odie2!
51
+ * Fix for settings link in plugin row - thanks to odie2!
52
+
53
+ = Version 1.7 - May 12th, 2014 =
54
 
55
  * Added Polish translation - thanks to maciejka45@gmail.com
56
  * Added Portuguese translation - thanks to Pedro Mendonça
top-level-cats.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: FV Top Level Categories
4
  Plugin URI: http://foliovision.com/seo-tools/wordpress/plugins/fv-top-level-categories
5
  Description: Removes the prefix from the URL for a category. For instance, if your old category link was <code>/category/catname</code> it will now be <code>/catname</code>
6
- Version: 1.7
7
  Author: Foliovision
8
  Author URI: http://foliovision.com/
9
  Text Domain: fv_tlc
@@ -50,7 +50,8 @@ function fv_top_level_categories_rewrite_rules($category_rewrite) {
50
  $pages_urls[] = trim( str_replace( get_bloginfo( 'url' ), '', get_permalink( $pages_item->ID ) ), '/' );
51
  }
52
  ///
53
-
 
54
  $category_rewrite=array();
55
  $categories=get_categories(array('hide_empty'=>false));
56
  foreach($categories as $category) {
@@ -68,11 +69,10 @@ function fv_top_level_categories_rewrite_rules($category_rewrite) {
68
 
69
 
70
  $category_rewrite['('.$category_nicename.')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
71
- $category_rewrite['('.$category_nicename.')/page/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
72
  $category_rewrite['('.$category_nicename.')/?$'] = 'index.php?category_name=$matches[1]';
73
  }
74
  // Redirect support from Old Category Base
75
- global $wp_rewrite;
76
  $old_category_base = get_option('category_base') ? get_option('category_base') : 'category';
77
  $old_category_base = trim($old_category_base, '/');
78
  $category_rewrite[$old_category_base.'/(.*)$'] = 'index.php?category_redirect=$matches[1]';
@@ -425,7 +425,7 @@ $FV_Top_Level_Cats = new FV_Top_Level_Cats;
425
 
426
  // Add settings link on plugin page
427
  function fv_top_level_categories_settings_link($links) {
428
- $settings_link = '<a href="options-general.php?page=fv_top_level_cats.php">' . __('Settings','fv_tlc') . '</a>';
429
  array_unshift($links, $settings_link);
430
  return $links;
431
  }
3
  Plugin Name: FV Top Level Categories
4
  Plugin URI: http://foliovision.com/seo-tools/wordpress/plugins/fv-top-level-categories
5
  Description: Removes the prefix from the URL for a category. For instance, if your old category link was <code>/category/catname</code> it will now be <code>/catname</code>
6
+ Version: 1.8
7
  Author: Foliovision
8
  Author URI: http://foliovision.com/
9
  Text Domain: fv_tlc
50
  $pages_urls[] = trim( str_replace( get_bloginfo( 'url' ), '', get_permalink( $pages_item->ID ) ), '/' );
51
  }
52
  ///
53
+ global $wp_rewrite;
54
+
55
  $category_rewrite=array();
56
  $categories=get_categories(array('hide_empty'=>false));
57
  foreach($categories as $category) {
69
 
70
 
71
  $category_rewrite['('.$category_nicename.')/(?:feed/)?(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
72
+ $category_rewrite['('.$category_nicename.')/'. $wp_rewrite->pagination_base .'/?([0-9]{1,})/?$'] = 'index.php?category_name=$matches[1]&paged=$matches[2]';
73
  $category_rewrite['('.$category_nicename.')/?$'] = 'index.php?category_name=$matches[1]';
74
  }
75
  // Redirect support from Old Category Base
 
76
  $old_category_base = get_option('category_base') ? get_option('category_base') : 'category';
77
  $old_category_base = trim($old_category_base, '/');
78
  $category_rewrite[$old_category_base.'/(.*)$'] = 'index.php?category_redirect=$matches[1]';
425
 
426
  // Add settings link on plugin page
427
  function fv_top_level_categories_settings_link($links) {
428
+ $settings_link = '<a href="options-general.php?page=fv_top_level_cats">' . __('Settings','fv_tlc') . '</a>';
429
  array_unshift($links, $settings_link);
430
  return $links;
431
  }