Plugin Directory

Changeset 1527018


Ignore:
Timestamp:
11/02/2016 10:04:38 PM (9 years ago)
Author:
edwardbenson
Message:

Pass shortcode content into the renderer

Location:
cloudstitch/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cloudstitch/trunk/cloudstitch-wordpress.php

    r1496008 r1527018  
    22/*
    33 * Plugin Name: Cloudstitch
    4  * Version: 1.5
     4 * Version: 1.6
    55 * Plugin URI: http://www.cloudstitch.io/wordpress
    66 * Description: This plugin lets you inject Cloudstitch widgets into your WordPress blog.
     
    1919/*
    2020 * [cloudstitch container="handlebars" user="ted" app="app"]
    21  *
    22  * HEAD
    23  *
    24  * HTML
    2521 *  <cloudstitch-handlebars user="foo" app="bar"></cloudstitch-handlebars>
    2622 */
    27 function handle_cloudstitch_container_shortcode($atts) {
     23function handle_cloudstitch_container_shortcode($atts, $content = null) {
    2824  $a = shortcode_atts( array(
    2925    'container' => '',
     
    3935  if ($a['container'] == 'dust') $a['container'] = 'cloudstitch-dust';
    4036  $component= "https://components.cloudstitch.com/{$a['container']}.html";
    41   $inline = "<{$a['container']} user=\"{$a['user']}\" app=\"{$a['app']}\" label=\"{$a['label']}\"></{$a['container']}>" .
     37  $inline = "<{$a['container']} user=\"{$a['user']}\" app=\"{$a['app']}\" label=\"{$a['label']}\">" . $content . "</{$a['container']}>" .
    4238    "<link href=\"$component\" rel=\"import\" />";
    4339  $script = "<script>maybeAdd('link', 'href', '$component', 'rel', 'import')</script>";
     
    4642
    4743//[cloudstitch]
    48 function handle_cloudstitch_shortcode( $atts ){
     44function handle_cloudstitch_shortcode( $atts, $content = null ){
    4945  $a = shortcode_atts( array(
    5046    'widget' => '',
     
    6359    return $html;
    6460  } else {
    65     return handle_cloudstitch_container_shortcode($atts);
     61    return handle_cloudstitch_container_shortcode($atts, $content);
    6662  }
    6763}
  • cloudstitch/trunk/readme.txt

    r1496008 r1527018  
    6666* Removes a style="display:block" attribute that was causing problems in some projects.
    6767
     68= 1.6 =
     69* Pass content inside the Cloudstitch short code into the Cloudstitch template engine.
     70
    6871== Upgrade Notice ==
    6972
     
    7780This version should be backward compatible with version 1.0.
    7881
     82= 1.6 =
     83This version should be backward compatible with version 1.0.
     84
    7985== Frequently Asked Questions ==
    8086
Note: See TracChangeset for help on using the changeset viewer.