Plugin Directory

Changeset 1254823


Ignore:
Timestamp:
09/28/2015 04:56:19 AM (9 years ago)
Author:
HoosierDragon
Message:

Release 1.2

Location:
text-toggle/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • text-toggle/trunk/avp-texttoggle.php

    r1246849 r1254823  
    5050        $return = '';
    5151
    52         extract( shortcode_atts( array( 'class' => null, 'title' => null ), $attributes ) );
     52        extract( shortcode_atts( array( 'class' => null, 'style' => null, 'title' => null ), $attributes ) );
    5353
    5454        if ( ( ! is_null( $title ) ) && ( ! is_null( $content ) ) )
     
    7272            $return .= '&nbsp;' . $title . '</a>';
    7373
     74            /*
     75             *  Create <div> statement, including class and style optional parameters
     76             */
     77            $return .= '<div ';
     78
    7479            if ( ( ! is_null( $class ) ) && ctype_alnum( $class ) )
    7580            {
    76                 $return .= '<div class="tt-div tt-div-' . $class . '">' . $content . '</div>';
     81                $return .= 'class="tt-div tt-div-' . $class . '" ';
    7782            }
    7883            else
    7984            {
    80                 $return .= '<div class="tt-div">' . $content . '</div>';
     85                $return .= 'class="tt-div" ';
    8186            }
     87
     88            if ( ! is_null( $style ) )
     89            {
     90                $valid = array( 'background-color', 'border', 'border-color', 'border-radius', 'border-size', 'border-style', 'color', );
     91
     92                $return .= 'style="';
     93                foreach ( $valid as $entry )
     94                {
     95                    if ( preg_match( "/(^|;\s*)($entry)\s*:\s*([0-9a-z!# ]+)\s*;?/i", $style, $matches ) )
     96                    {
     97                        $return .= $matches[ 2 ] . ':' . $matches[ 3 ] . ';';
     98                    }
     99                }
     100                $return .= '" ';
     101            }
     102
     103            $return .= '>' . $content . '</div>';
    82104        }
    83105
  • text-toggle/trunk/css/avp-texttoggle.css

    r1246849 r1254823  
    88div.tt-div
    99{
    10     display:none;
     10    display:none !important;
    1111}
    1212
  • text-toggle/trunk/readme.txt

    r1246849 r1254823  
    66Requires at least: 2.9.2
    77Tested up to: 4.3
    8 Stable tag: 1.1
    9 Version: 1.1
     8Stable tag: 1.2
     9Version: 1.2
    1010Author: Terry O'Brien
    1111Author link: http://www.terryobrien.com
     
    3232= Parameters =
    3333
    34 The "[tt]" shortcode has one required parameter and one optional parameter, plus the required content of the shortcode.
     34The "[tt]" shortcode has one required parameter and two optional parameters, plus the required content of the shortcode.
    3535
    3636* The "class" parameter is optional: this links the particular text area with the "[tt_part]" shortcode, which can display or hide groups of text areas. This parameter must consist of only letters and numbers.
     37* The "style" parameter is optional: this allows the author to apply CSS style components to the given shortcode content, which will only be visible when the content is made visible. Style components are limited to anything that applies to the area surrounding and including the area to be displayed and are limited to the following: background-color, border, border-color, border-radius, border-size, border-style, and color. Any other style components or any other text will be ignored.
    3738* The "title" parameter is required: this what is displayed as the title of the text area and is used as the control link.
    3839
     
    6667== Changelog ==
    6768
     69= 1.2 =
     70
     71* Add optional styling parameters to the [tt] shortcode.
     72
    6873= 1.1 =
    6974
     
    7883== Upgrade Notice ==
    7984
     85= 1.2 =
     86
     87Added "style" parameter to the [tt] shortcode. A short set of CSS style codes may be applied to individual text segments.
     88
    8089= 1.1 =
    8190
Note: See TracChangeset for help on using the changeset viewer.