Skip to content

Commit d155705

Browse files
committed
Minor formatting changes.
1 parent c9e844c commit d155705

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

src/php/cloud/list-table-shared-ops.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,6 @@ function cloud_lts_display_column_hidden_input( string $column_name, Cloud_Snipp
2727
);
2828
}
2929

30-
/**
31-
* Display a hidden input field for a certain column and snippet value.
32-
*
33-
* @param string $column_name Column name.
34-
* @param Cloud_Snippet $snippet Column item.
35-
*
36-
* @return string HTML
37-
*/
38-
function cloud_lts_build_column_hidden_input( string $column_name, Cloud_Snippet $snippet ): string {
39-
return sprintf(
40-
'<input id="cloud-snippet-%s-%s" class="cloud-snippet-item" type="hidden" name="%s" value="%s" />',
41-
esc_attr( $column_name ),
42-
esc_attr( $snippet->id ),
43-
esc_attr( $column_name ),
44-
esc_attr( $snippet->$column_name )
45-
);
46-
}
47-
4830
/**
4931
* Process the download snippet action
5032
*

src/php/front-end/class-front-end.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ protected function convert_boolean_attribute_flags( array $atts, array $boolean_
240240
*
241241
* @return string Evaluated shortcode content.
242242
*/
243-
protected function evaluate_shortcode_content( Snippet $snippet, array $atts ): string {
243+
protected function evaluate_shortcode_content( Snippet $snippet, array $atts ): string {
244244
if ( empty( $atts['php'] ) ) {
245245
return $snippet->code;
246246
}
@@ -332,19 +332,20 @@ public function render_content_shortcode( array $atts ): string {
332332

333333
// Recursion depth is limited to prevent infinite loops.
334334
static $depth = 0;
335-
$max_depth = self::MAX_SHORTCODE_DEPTH;
336335

337336
// Find the shortcode in the content and replace it with the evaluated content.
338337
$content = preg_replace_callback(
339-
'/\[' . self::CONTENT_SHORTCODE . '([^\]]*)\]/',
340-
function ($matches) use (&$depth, $max_depth) {
341-
if ($depth >= $max_depth) {
338+
'/\[' . self::CONTENT_SHORTCODE . '([^]]*)]/',
339+
function ( $matches ) use ( &$depth ) {
340+
if ( $depth >= self::MAX_SHORTCODE_DEPTH ) {
342341
return '<!-- Max shortcode depth reached -->';
343342
}
343+
344344
$depth++;
345-
$atts = shortcode_parse_atts($matches[1]);
346-
$result = $this->render_content_shortcode($atts);
345+
$atts = shortcode_parse_atts( $matches[1] );
346+
$result = $this->render_content_shortcode( $atts );
347347
$depth--;
348+
348349
return $result;
349350
},
350351
$content

0 commit comments

Comments
 (0)