SEOPress - Version 3.7.7.1

Version Description

  • FIX Remove /category/ in permalinks to target "category" taxonomy only by default
Download this release

Release Info

Developer rainbowgeek
Plugin Icon 128x128 SEOPress
Version 3.7.7.1
Comparing to
See all releases

Code changes from version 3.7.7 to 3.7.7.1

Files changed (3) hide show
  1. inc/functions/options.php +15 -11
  2. readme.txt +3 -1
  3. seopress.php +2 -2
inc/functions/options.php CHANGED
@@ -478,20 +478,24 @@ if (seopress_get_toggle_advanced_option() =='1') {
478
  return $rules;
479
  }
480
 
481
- function seopress_remove_category_base( $link ) {
482
- $category_base = get_option( 'category_base' );
483
- if ( '' == $category_base ) {
484
- $category_base = 'category';
485
- }
 
486
 
487
- if ( '/' == substr( $category_base, 0, 1 ) ) {
488
- $category_base = substr( $category_base, 1 );
489
- }
490
- $category_base .= '/';
491
 
492
- return preg_replace( '`' . preg_quote( $category_base, '`' ) . '`u', '', $link, 1 );
 
 
 
493
  }
494
- add_filter( 'term_link', 'seopress_remove_category_base' );
495
 
496
  add_action('template_redirect', 'seopress_category_redirect', 1);
497
  function seopress_category_redirect(){
478
  return $rules;
479
  }
480
 
481
+ function seopress_remove_category_base( $termlink, $term, $taxonomy ) {
482
+ if ($taxonomy =='category') {
483
+ $category_base = get_option( 'category_base' );
484
+ if ( '' == $category_base ) {
485
+ $category_base = 'category';
486
+ }
487
 
488
+ if ( '/' == substr( $category_base, 0, 1 ) ) {
489
+ $category_base = substr( $category_base, 1 );
490
+ }
491
+ $category_base .= '/';
492
 
493
+ return preg_replace( '`' . preg_quote( $category_base, '`' ) . '`u', '', $termlink, 1 );
494
+ } else {
495
+ return $termlink;
496
+ }
497
  }
498
+ add_filter( 'term_link', 'seopress_remove_category_base', 10, 3 );
499
 
500
  add_action('template_redirect', 'seopress_category_redirect', 1);
501
  function seopress_category_redirect(){
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: SEO, XML sitemap, meta title, open graph, content analysis, knowledge grap
6
  Requires at least: 4.7+
7
  Tested up to: 5.3
8
  Requires PHP: 5.6
9
- Stable tag: 3.7.7
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -270,6 +270,8 @@ You're theme is probably using a deprecated function to handle the title. <a hre
270
  60. Installation Wizard
271
 
272
  == Changelog ==
 
 
273
  = 3.7.7 =
274
  * NEW WordPress 4.7 is now the minimum required to use SEOPress (WP 5.3 is recommended)
275
  * NEW Add %%page%% dynamic variable, current page number with context (eg: "Page 1 of 4")
6
  Requires at least: 4.7+
7
  Tested up to: 5.3
8
  Requires PHP: 5.6
9
+ Stable tag: 3.7.7.1
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
270
  60. Installation Wizard
271
 
272
  == Changelog ==
273
+ = 3.7.7.1 =
274
+ * FIX Remove /category/ in permalinks to target "category" taxonomy only by default
275
  = 3.7.7 =
276
  * NEW WordPress 4.7 is now the minimum required to use SEOPress (WP 5.3 is recommended)
277
  * NEW Add %%page%% dynamic variable, current page number with context (eg: "Page 1 of 4")
seopress.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: One of the best SEO plugins for WordPress.
6
- Version: 3.7.7
7
  Author: SEOPress
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
@@ -53,7 +53,7 @@ register_deactivation_hook(__FILE__, 'seopress_deactivation');
53
  ///////////////////////////////////////////////////////////////////////////////////////////////////
54
  //Define
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
- define( 'SEOPRESS_VERSION', '3.7.7' );
57
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
58
 
59
  ///////////////////////////////////////////////////////////////////////////////////////////////////
3
  Plugin Name: SEOPress
4
  Plugin URI: https://www.seopress.org/
5
  Description: One of the best SEO plugins for WordPress.
6
+ Version: 3.7.7.1
7
  Author: SEOPress
8
  Author URI: https://www.seopress.org/
9
  License: GPLv2
53
  ///////////////////////////////////////////////////////////////////////////////////////////////////
54
  //Define
55
  ///////////////////////////////////////////////////////////////////////////////////////////////////
56
+ define( 'SEOPRESS_VERSION', '3.7.7.1' );
57
  define( 'SEOPRESS_AUTHOR', 'Benjamin Denis' );
58
 
59
  ///////////////////////////////////////////////////////////////////////////////////////////////////