• Hi, Mike – Great plugin again. I’m having trouble getting the class attribute to appear in the resulting div. Here is my code:
    the_boilerplate(86,'id',array('showtitle'=>'0','id'=>'myID','class'=>'myClass'));

    The resulting HTML looks like this:

    <div id="myID" class="">
    ... boilerplate stuff
    </div>

    The id appears as you can see, but no class value. This is also the case if id=” or is not specified. Your suggestions are appreciated!

    https://www.ads-software.com/extend/plugins/wp-boilerplate-shortcode/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mike Schinkel

    (@mikeschinkel)

    I haven’t had time to update the repository but here’s an update. Can you try it?

    Thread Starter philzo

    (@philzo)

    Thanks, Mike – A couple things on v1.0.5

    1) After removing the old and activating the new plugin, I got the following error:
    Fatal error: Call to undefined method WPBoilerplateShortcode::boilerplate_shortcode() in wp-content/plugins/wp-boilerplate-shortcode/wp-boilerplate-shortcode.php on line 32

    Line 32 is looking for the function ‘boilerplate_shortcode’ but in this version it is called ‘shortcode’. So, I changed ‘shortcode’ on line 40 (where you add_shortcode) and the name of the function on line 171 to ‘boilerplate_shortcode’. That cleared the error.

    2) I still had the problem with the css class not appearing. In the function ‘shortcode’ (now called ‘boilerplate_shortcode’ in my copy) $class is not defined. I simply added
    $class = $args->class;
    below line 204, where $div_id is defined and now my css class is appearing as expected.

    Plugin Author Mike Schinkel

    (@mikeschinkel)

    Ugh! Well, those were two logic paths I hadn’t tested. Hopefully v1.0.6 will fix the errors you found?

    BTW, I’ve forgotten how to update the plugin on the repository so I need to find time to figure out how to do that. Soon.

    Thread Starter philzo

    (@philzo)

    looks good, thanks! just need to change the version number in the code ??

    cheers!

    Plugin Author Mike Schinkel

    (@mikeschinkel)

    <sigh…> Yes, thanks for catching that. Updated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WP Boilerplate Shortcode] Can't get 'class' attribute to appear’ is closed to new replies.