• frankieandshadow

    (@frankieandshadow)


    Hi,

    I have a custom widget which is displaying through Widget Shortcode, but without any of the widget params getting through to it. I have traced the problem to line 173 of init.php:

    preg_match( '/(\d+)/', $id, $number )

    The problem is my widget is called “lsa3_button”, and $id=”lsa3_button-5″, so $number gets [3,3] (from my widget name) not [5,5] (as the instance). I think you need something like

    preg_match( '/-(\d+)$/', $id, $number )

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter frankieandshadow

    (@frankieandshadow)

    …and then use $number[1] not $number[0]!

    Thread Starter frankieandshadow

    (@frankieandshadow)

    I have a fix for this (and the other similar one) ready to go into SVN. How do I check it in please? It’s asking for credentials.

    Plugin Author shazdeh

    (@shazdeh)

    Very good point indeed. Tested, and suggested solution works beautifully. Patch applied and pushed. Credited in changelogs as well ??
    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bug in widget id’ is closed to new replies.