File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 11<?php
2- /**
3- *
4- * 注册短代码
5- *
6- * @author MaiCong <i@maicong.me>
7- * @link https://github.com/maicong/stay
8- * @since 1.5.7
9- *
10- */
2+ /* 注册短代码 */
113
124if (!defined ('__TYPECHO_ROOT_DIR__ ' )) exit ;
135
@@ -134,7 +126,7 @@ function shortcode_shrinks( $atts, $content = '' ) {
134126 foreach ( $ args as $ k => $ v ) {
135127 $ attr_strings [] = $ k . '=" ' . htmlspecialchars ( $ v , ENT_QUOTES , 'UTF-8 ' ) . '" ' ;
136128 }
137- return '<div class="panel panel- ' .$ args ['style ' ].' shrinkBox ' .$ args ['checked ' ].'" >
129+ return '<div class="panel panel- ' .$ args ['style ' ].' shrinkBox ' .( isset ( $ args ['checked ' ]) ? $ args [ ' checked ' ] : '' ) .'" >
138130 <div class="panel-heading shrinkBox-title" onclick="$(this).parent().toggleClass( \'active \');"> ' .$ args ['title ' ].'</div><div class="panel-body shrinkBox-content"> ' .$ content .'</div></div> ' ;
139131}
140132add_shortcode ( 'shrinks ' , 'shortcode_shrinks ' );
@@ -155,6 +147,6 @@ function shortcode_alert( $atts, $content = '' ) {
155147 foreach ( $ args as $ k => $ v ) {
156148 $ attr_strings [] = $ k . '=" ' . htmlspecialchars ( $ v , ENT_QUOTES , 'UTF-8 ' ) . '" ' ;
157149 }
158- return '<div class="alert alert- ' .$ args ['style ' ].' ' .$ args ['close ' ].'" role="alert"> ' .$ closebutton .$ content .'</div> ' ;
150+ return '<div class="alert alert- ' .$ args ['style ' ].' ' .( isset ( $ args ['close ' ]) ? $ args [ ' close ' ] : '' ) .'" role="alert"> ' .$ closebutton .$ content .'</div> ' ;
159151}
160152add_shortcode ( 'alert ' , 'shortcode_alert ' );
You can’t perform that action at this time.
0 commit comments