Title: simple building blocks
Last modified: August 22, 2016

---

# simple building blocks

 *  Resolved [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/)
 * Please consider including a [block] shortcode
    [https://github.com/szepeviktor/wordpress-plugin-construction/blob/master/mu-block-shortcodes/block-shortcodes.php](https://github.com/szepeviktor/wordpress-plugin-construction/blob/master/mu-block-shortcodes/block-shortcodes.php)
   You can build any content with simple div-s. The [block] accepts any attribute
   and converts them to HTML.
 * Thank you!
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249709)
 * I’ve looked into this, and my first impression is that it doesn’t seem so efficient
   to use:
 *     ```
       [block class="test"]
       ```
   
 * when the original is shorter:
 *     ```
       <div class="test">
       ```
   
 * At the same time, I can imagine some enhanced features for blocks that could 
   do more than a simple div. Please let me think about it some more – I appreciate
   the suggestion!
 * By the way, I found in your github a repo for shortcode unautop. This could be
   useful to include in the plugin!
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249736)
 * The main advatage of [block]-s are the visibility in Visual mode.
    So a client
   cannot mess it up so easily. `<div class="test">` is hidden in Visual mode and
   a simple hit of the backspace eliminates the class.
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249737)
 * This [site](http://www.prezimagyarul.hu/roadshow/) is built with [blocks] and
   can be edited without HTML knowledge.
 * You only have to pay attention not to delete a shortcode.
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249738)
 * “shortcode unautop” is a must – for me – because WP generates stray `</p>`-s 
   from block level element-generating shorcodes – which are invalid.
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249751)
 * That’s a good point about visibility in Visual editor, it could be useful for
   some people. OK, I’ll add an option to turn on [block] shortcodes.
 * About shortcode unautop – I had to struggle to solve the auto-formatting issue
   with multi-line shortcodes, especially [loop]. The most recent solution was to
   include an option in the plugin settings page, to move wpautop filter to _after_
   shortcodes are processed. With this enabled, it might not be necessary to include
   shortcode unautop. If you would care to try it, I’m curious if that works.
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249758)
 * Yes. It works without shortcode unautop when “Move post content formatting (wp_autop)
   to after shortcodes” is turned on.
    The output is valid HTML.
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249759)
 * Is this `return do_shortcode( shortcode_unautop( trim( $content ) ) );` that 
   does is all?
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249843)
 * > OK, I’ll add an option to turn on [block] shortcodes.
 * Finally is `[block]` added?
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249844)
 * To embed one into another it would be necessary to add block and block1..block9
   also.
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [11 years ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249846)
 * Hi Viktor,
 * I finally included [block] shortcodes in a recent update. Wow, your original 
   request was 7 months ago – sorry it took so long! One reason is, I wondered if
   there’s a common need for it. The plugin is constantly growing and I was afraid
   to include too many features.
 * You can see in the documentation, I implemented it a little differently. The 
   main difference is that nested blocks are written like this:
 *     ```
       [block]
         [-block]
           [--block]
             ...
           [/--block]
         [/-block]
       [/block]
       ```
   
 * I also added all major HTML tags like div, article, section, span, as shortcodes.
   Not sure if that was such a good idea – but it’s there now!
 * While working on this feature, I had an idea that these blocks can have extended
   functions, like responsive blocks. I’ll think about it – probably the best is
   to place hooks that can be used to add new functionality.
 * Anyway, thank you for the suggestion!
 *  Thread Starter [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * (@szepeviktor)
 * [11 years ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249847)
 * Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘simple building blocks’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

## Tags

 * [div](https://wordpress.org/support/topic-tag/div/)

 * 11 replies
 * 2 participants
 * Last reply from: [Viktor Szépe](https://wordpress.org/support/users/szepeviktor/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/simple-building-blocks/#post-5249847)
 * Status: resolved