Plus/Minus icons do not change
-
When clicking the plus icon on the knowledge base, the icon does not toggle.
There is a 404 being thrown. It looks like the path to the image doesn’t swap out properly, and the element .kbe_category span.switch img has a hardcoded reference to the plus sign.
On initial load the href attribute is:
https://www.example.com/wp-content/plugins/wp-knowledgebase/template/images/kbe_icon-plus.pngwhen clicked it becomes
https://www.example.com/wp-content/plugins/wp-knowledgebase/template/images/kbe_icon-plus.png/template/images/kbe_icon-minus.pngInside of the script loaded on the page, it appears the href attributes are incorrect, causing the issue:
jQuery('div.kbe_category > span.switch').click(function () { var tree_id = jQuery(this).parent().attr('id'); if (jQuery(this).hasClass('open')) { jQuery(this).parent().find('div:first').slideUp('fast'); jQuery(this).removeClass('open'); jQuery(this).html('<img src="https://www.example.com/wp-content/plugins/wp-knowledgebase/template/images/kbe_icon-plus.png/template/images/kbe_icon-plus.png" />'); } else { jQuery(this).parent().find('div:first').slideDown('fast'); jQuery(this).html('<img src="https://www.example.com/wp-content/plugins/wp-knowledgebase/template/images/kbe_icon-plus.png/template/images/kbe_icon-minus.png" />'); jQuery(this).addClass('open'); } });
Fix:
After some additional digging, inside of
wp-knowledgebase/wp-knowledgebase.php
, line 457 and line 460 should be:jQuery(this).html('<img src="<?php echo plugins_url('template/images/kbe_icon-plus.png',__FILE__) ?>" />');
and
jQuery(this).html('<img src="<?php echo plugins_url('template/images/kbe_icon-minus.png',__FILE__) ?>" />');
respectively.
And to account for the the hard coded plus background image:
.kbe_category span.switch img { content: none; }
or remove the
content
line altogether.
- The topic ‘Plus/Minus icons do not change’ is closed to new replies.