Remove Category URL - Version 1.0.2

Version Description

  • Update Compatible with WPML.
Download this release

Release Info

Developer valeriosza
Plugin Icon 128x128 Remove Category URL
Version 1.0.2
Comparing to
See all releases

Code changes from version 0.1.0 to 1.0.2

Files changed (3) hide show
  1. readme.txt +17 -5
  2. remove-category-url.php +2 -2
  3. uninstall.php +19 -0
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: valeriosza
3
  Tags: categories, category base, category, permalinks, URL structure, links, seo, cms, wpml, URL
4
  Requires at least: 3.1
5
- Tested up to: 4.1
6
- Stable tag: 0.1.0
7
  License: GPLv2
8
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=P5QTGDB64SU8E&lc=US&item_name=WordPress%20Plugins&no_note=0&cn=Adicionar%20instru%c3%a7%c3%b5es%20especiais%20para%20o%20vendedor%3a&no_shipping=1&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
9
 
@@ -35,8 +35,8 @@ Want to help? Use the [support](https://wordpress.org/support/plugin/remove-cate
35
 
36
  == Installation ==
37
 
38
- 1. Upload `remove-category-url.zip` to the `/wp-content/plugins/` directory
39
- 2. Activate the plugin through the 'Plugins' menu in WordPress
40
  3. That's it! You sould now be able to access your categories via http://mydomain.com/my-category/
41
 
42
  == Frequently Asked Questions ==
@@ -63,10 +63,22 @@ A particular installation does not allow the rewrite feature in disabling the pl
63
 
64
  == Changelog ==
65
 
 
 
 
 
 
 
66
  = 0.1.0 =
67
  * Initial release.
68
 
69
  == Upgrade Notice ==
70
 
 
 
 
 
 
 
71
  = 0.1.0 =
72
- * Initial release.
2
  Contributors: valeriosza
3
  Tags: categories, category base, category, permalinks, URL structure, links, seo, cms, wpml, URL
4
  Requires at least: 3.1
5
+ Tested up to: 4.2
6
+ Stable tag: 1.0.2
7
  License: GPLv2
8
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=P5QTGDB64SU8E&lc=US&item_name=WordPress%20Plugins&no_note=0&cn=Adicionar%20instru%c3%a7%c3%b5es%20especiais%20para%20o%20vendedor%3a&no_shipping=1&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
9
 
35
 
36
  == Installation ==
37
 
38
+ 1. Upload `remove-category-url.zip` to the `/wp-content/plugins/` directory.
39
+ 2. Activate the plugin through the 'Plugins' menu in WordPress.
40
  3. That's it! You sould now be able to access your categories via http://mydomain.com/my-category/
41
 
42
  == Frequently Asked Questions ==
63
 
64
  == Changelog ==
65
 
66
+ = 1.0.2 =
67
+ * Update Compatible with WPML.
68
+
69
+ = 0.1.1 =
70
+ * Add uninstall.
71
+
72
  = 0.1.0 =
73
  * Initial release.
74
 
75
  == Upgrade Notice ==
76
 
77
+ = 1.0.2 =
78
+ * Update Compatible with WPML.
79
+
80
+ = 0.1.1 =
81
+ * Add uninstall.
82
+
83
  = 0.1.0 =
84
+ * Initial release.
remove-category-url.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Remove Category URL
4
  Plugin URI: https://github.com/valeriosouza/remove-category-url
5
  Description: This plugin removes '/category' from your category permalinks. (e.g. `/category/my-category/` to `/my-category/`)
6
- Version: 0.1.0
7
  Author: Valerio Souza
8
  Author URI: http://valeriosouza.com.br/
9
  */
@@ -65,7 +65,7 @@ function remove_category_url_rewrite_rules($category_rewrite)
65
  if (class_exists('Sitepress')) {
66
  global $sitepress;
67
  remove_filter('terms_clauses', array($sitepress, 'terms_clauses'));
68
- $categories = get_categories(array('hide_empty' => false));
69
  add_filter('terms_clauses', array($sitepress, 'terms_clauses'));
70
  } else {
71
  $categories = get_categories(array('hide_empty' => false));
3
  Plugin Name: Remove Category URL
4
  Plugin URI: https://github.com/valeriosouza/remove-category-url
5
  Description: This plugin removes '/category' from your category permalinks. (e.g. `/category/my-category/` to `/my-category/`)
6
+ Version: 1.0.2
7
  Author: Valerio Souza
8
  Author URI: http://valeriosouza.com.br/
9
  */
65
  if (class_exists('Sitepress')) {
66
  global $sitepress;
67
  remove_filter('terms_clauses', array($sitepress, 'terms_clauses'));
68
+ $categories = get_categories(array('hide_empty' => false, '_icl_show_all_langs' => true));
69
  add_filter('terms_clauses', array($sitepress, 'terms_clauses'));
70
  } else {
71
  $categories = get_categories(array('hide_empty' => false));
uninstall.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Fired when the plugin is uninstalled.
4
+ *
5
+ * @package Remove_Category_URL
6
+ * @author Valerio Souza <eu@valeriosouza.com.br>
7
+ * @license GPL-2.0+
8
+ * @link http://wordpress.org/plugins/remove-category-url
9
+ * @copyright 2013 CodeHost
10
+ */
11
+
12
+ // If uninstall not called from WordPress, then exit
13
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
14
+ exit;
15
+ }
16
+
17
+ remove_filter('category_rewrite_rules', 'remove_category_url_rewrite_rules');
18
+ global $wp_rewrite;
19
+ $wp_rewrite->flush_rules();