• Resolved mw360

    (@mw360)


    Hello,
    Great plugin – but have a need for special site, which is having a ‘back button’ in the breadcrumb just in front of the ‘home’ – (yes I know browsers have back buttons etc etc – this is a special circumstance). So, tried applying it to the beginning of the Home Breadcrumb by adding

    <a href="#" onclick="window.history.go(-1); return false;">Previous</a> |

    But it saves it as:

    <a href="#">Previous</a> |

    Is onclick being filtered?

    https://ww.wp.xz.cn/plugins/breadcrumb-navxt/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Havlik

    (@mtekk)

    By default, Breadcrumb NavXT only accepts a small range of HTML tags and properties within the tags for the breadcrumb templates (they are passed through wp_kses). You can add to the list of accepted tags and properties, see http://mtekk.us/archives/guides/how-to-add-li-and-other-tags-to-breadcrumb-templates/ for more details.

    Thread Starter mw360

    (@mw360)

    Hi and thanks.

    Solves the issue, great! Thanks for incorporating this filter.

    For the record, since the linked example refers to
    ‘li’ and in my case I am adjusting ‘a’, below is the code I added to custom functions for this particular case (note the onclick added at the end):

    function my_bcn_allowed_html($allowed_html)
    {
        $allowed_html['a'] = array(
    		'href' => true,
    		'title' => true,
    		'class' => true,
    		'id' => true,
    		'media' => true,
    		'dir' => true,
    		'relList' => true,
    		'rel' => true,
    		'aria-hidden' => true,
    		'data-icon' => true,
    		'itemref' => true,
    		'itemid' => true,
    		'itemprop' => true,
    		'itemscope' => true,
    		'itemtype' => true,
    		'xmlns:v' => true,
    		'typeof' => true,
    		'property' => true,
    		'onclick' => true
        );
        return $allowed_html;
    }
    add_filter('bcn_allowed_html', 'my_bcn_allowed_html');
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘onclick?’ is closed to new replies.