Support » Plugin: Widget Shortcode » Title not being displayed – plugin 0.2.7

  • Resolved andyrushtonprogramming


    I have just updated this plugin to the latest version – 0.2.7 – and the titles of widgets are now not being displayed. I put some debug code into one of my own widgets and got the following output:

    [31-Aug-2016 09:34:32 UTC] recent notices: instance: Array
        [title] => Recent Notices
        [number] => 5
    [31-Aug-2016 09:34:32 UTC] recent notices: args: Array
        [before_widget] => <div id="recent-notices-7" class="widget ahpp-widget-recent-notices">
        [after_widget] => </div>
        [before_title] => <!-- widget_shortcode_before_title -->
        [after_title] => <!-- widget_shortcode_after_title -->
        [name] => Arbitrary
        [id] => arbitrary
        [description] => This widget area can be used for [widget] shortcode.
        [widget_id] => recent-notices-7
        [widget_name] => Recent Notices

    So it seems that the before_title and after_title settings are comments. Furthermore, somehow this setting is causing the widget’s title output to get filtered out.

    I haven’t been able to pin down where the filter is, but when I echo just the title it appears, when I add the before_title and after_title, the whole title disappears so WP must have a filter on this output that removes lines with comments in them (or something like that).

    It seems to me this is a bug? The docs say the before_title and after_title are h2 tags.

Viewing 4 replies - 1 through 4 (of 4 total)
  • I too have the same problem at my website. Please fix the issue ASAP.
    If you (developer) need help to debug the issue, please contact me by mail

    The new update has added an alternative to disable title display, to use either ‘0’ or ‘no’. The method is a ‘haystack’ search of the string that requires a third ‘=’ to determine true or false.

    The fix
    In init.php of the plugin’s primary file, find the line that is
    $show_title = ( '0' == $title || 'no' == $title ) ? false : true;
    and add an additional ‘=’ to each condition like this
    $show_title = ( '0' === $title || 'no' === $title ) ? false : true;

    Thanks for the fix. I can confirm it works, and the titles are back.

    Plugin Author shazdeh


    So sorry about this issue. This is fixed now, the plugin updated.
    @websitedons: Thank you for the patch, it indeed works.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Title not being displayed – plugin 0.2.7’ is closed to new replies.