WP Boilerplate Shortcode
Can't get 'class' attribute to appear (6 posts)

  1. philzo
    Posted 5 years ago #

    Hi, Mike - Great plugin again. I'm having trouble getting the class attribute to appear in the resulting div. Here is my code:

    The resulting HTML looks like this:

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

    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!


  2. Mike Schinkel
    Plugin Author

    Posted 5 years ago #

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

  3. philzo
    Posted 5 years ago #

    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.

  4. Mike Schinkel
    Plugin Author

    Posted 5 years ago #

    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.

  5. philzo
    Posted 5 years ago #

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


  6. Mike Schinkel
    Plugin Author

    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Boilerplate Shortcode
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic