Skip to content

Commit

Permalink
Merge pull request #55 from brainstormforce/display-rule-issue
Browse files Browse the repository at this point in the history
AST-3305 - Fix:Display ruleset not working as expected on singular post/tag/page
  • Loading branch information
imnavanath authored Jul 18, 2023
2 parents da0affa + ca0abcf commit 624d6ef
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**Tags:** custom sidebar, sidebar manager, custom widget areas, widgets, conditional sidebar
**Requires at least:** 4.0
**Tested up to:** 6.2
**Stable tag:** 1.1.7
**Stable tag:** 1.1.8
**License:** GPLv2 or later
**License URI:** https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -53,6 +53,9 @@ Other plugins we found are heavy with ugly interface, non supported, developed o

## Changelog ##

### 1.1.8 ###
- Fix: Sidebar rendering issue where specifying "All Singulars from {{category}}" resulted in incorrect display of "{{category}} - Category" after saving.

### 1.1.7 ###
- Fix: Added compatibility with WordPress v5.7 for jQuery migration warnings on admin page.

Expand Down
10 changes: 8 additions & 2 deletions classes/modules/target-rule/class-bsf-sb-target-rules-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,17 @@ public static function generate_target_rule_selector( $type, $selection_options,

// taxonomy options.
if ( strpos( $sel_value, 'tax-' ) !== false ) {
$suffix = '';
$term_suffix = '';
if ( preg_match( '/\d+(-single-.+)$/', $sel_value, $m ) ) {
$suffix = $m[1];
$term_suffix = ' (Singulars)';
}

$tax_id = (int) str_replace( 'tax-', '', $sel_value );
$term = get_term( $tax_id );
$term_taxonomy = ucfirst( str_replace( '_', ' ', $term->taxonomy ) );
$output .= '<option value="tax-' . $tax_id . '" selected="selected" >' . $term->name . ' - ' . $term_taxonomy . '</option>';

$output .= '<option value="tax-' . $tax_id . $suffix . '" selected="selected">' . $term->name . ' - ' . $term_taxonomy . $term_suffix . '</option>';
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@
"sh bin/block-commits-with-merge-conflict.sh"
]
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sidebar-manager",
"version": "1.1.7",
"version": "1.1.8",
"main": "Gruntfile.js",
"author": "Brainstorm Force",
"devDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BrainstormForce
Tags: custom sidebar, sidebar manager, custom widget areas, widgets, conditional sidebar
Requires at least: 4.0
Tested up to: 6.2
Stable tag: 1.1.7
Stable tag: 1.1.8
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -51,8 +51,12 @@ Other plugins we found are heavy with ugly interface, non supported, developed o
1. Add Content to the newly created sidebar.



== Changelog ==

= 1.1.8 =
- Fix: Sidebar rendering issue where specifying "All Singulars from {{category}}" resulted in incorrect display of "{{category}} - Category" after saving.

= 1.1.7 =
- Fix: Added compatibility with WordPress v5.7 for jQuery migration warnings on admin page.

Expand Down
4 changes: 2 additions & 2 deletions sidebar-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Sidebar Manager
* Plugin URI: http://www.brainstormforce.com
* Description: This is the plugin to create custom siderbars to your site.
* Version: 1.1.7
* Version: 1.1.8
* Author: Brainstorm Force
* Author URI: https://www.brainstormforce.com/
* Text Domain: bsfsidebars
Expand All @@ -25,7 +25,7 @@
define( 'BSF_SB_BASE', plugin_basename( BSF_SB_FILE ) );
define( 'BSF_SB_DIR', plugin_dir_path( BSF_SB_FILE ) );
define( 'BSF_SB_URL', plugins_url( '/', BSF_SB_FILE ) );
define( 'BSF_SB_VER', '1.1.7' );
define( 'BSF_SB_VER', '1.1.8' );
define( 'BSF_SB_PREFIX', 'bsf-sb' );
define( 'BSF_SB_POST_TYPE', 'bsf-sidebar' );

Expand Down

0 comments on commit 624d6ef

Please sign in to comment.