Changeset 1254823
- Timestamp:
- 09/28/2015 04:56:19 AM (9 years ago)
- Location:
- text-toggle/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
text-toggle/trunk/avp-texttoggle.php
r1246849 r1254823 50 50 $return = ''; 51 51 52 extract( shortcode_atts( array( 'class' => null, ' title' => null ), $attributes ) );52 extract( shortcode_atts( array( 'class' => null, 'style' => null, 'title' => null ), $attributes ) ); 53 53 54 54 if ( ( ! is_null( $title ) ) && ( ! is_null( $content ) ) ) … … 72 72 $return .= ' ' . $title . '</a>'; 73 73 74 /* 75 * Create <div> statement, including class and style optional parameters 76 */ 77 $return .= '<div '; 78 74 79 if ( ( ! is_null( $class ) ) && ctype_alnum( $class ) ) 75 80 { 76 $return .= ' <div class="tt-div tt-div-' . $class . '">' . $content . '</div>';81 $return .= 'class="tt-div tt-div-' . $class . '" '; 77 82 } 78 83 else 79 84 { 80 $return .= ' <div class="tt-div">' . $content . '</div>';85 $return .= 'class="tt-div" '; 81 86 } 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>'; 82 104 } 83 105 -
text-toggle/trunk/css/avp-texttoggle.css
r1246849 r1254823 8 8 div.tt-div 9 9 { 10 display:none ;10 display:none !important; 11 11 } 12 12 -
text-toggle/trunk/readme.txt
r1246849 r1254823 6 6 Requires at least: 2.9.2 7 7 Tested up to: 4.3 8 Stable tag: 1. 19 Version: 1. 18 Stable tag: 1.2 9 Version: 1.2 10 10 Author: Terry O'Brien 11 11 Author link: http://www.terryobrien.com … … 32 32 = Parameters = 33 33 34 The "[tt]" shortcode has one required parameter and one optional parameter, plus the required content of the shortcode.34 The "[tt]" shortcode has one required parameter and two optional parameters, plus the required content of the shortcode. 35 35 36 36 * 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. 37 38 * The "title" parameter is required: this what is displayed as the title of the text area and is used as the control link. 38 39 … … 66 67 == Changelog == 67 68 69 = 1.2 = 70 71 * Add optional styling parameters to the [tt] shortcode. 72 68 73 = 1.1 = 69 74 … … 78 83 == Upgrade Notice == 79 84 85 = 1.2 = 86 87 Added "style" parameter to the [tt] shortcode. A short set of CSS style codes may be applied to individual text segments. 88 80 89 = 1.1 = 81 90
Note: See TracChangeset
for help on using the changeset viewer.